Hello expert.
I want to make a program in VB in which I have an image file i,e jpg, tif etc.
How can I open this image file and read the text and generate a text file?
If there is any idea then please send me.
Thanks in advance.
12 7984
How the image file contains text?
Still then if you want to open then use in a richtextbox. Using that control you can open any type of file even dll and exe also.
hello expert
i want to make programe in vb in which i have an image file i,e jpg, tif etc
how i can open this image file and read the text and generate a text file .
if there is any idea then please send me
thaks in advance
If you are trying to create a program like OmniPage, you have an enormous task. The characters that you see in an image file are just composed of dots called pixels, there are no ascii characters. Plus, image file formats are pretty tough. HTH --Sam
hello expert
i got this code from internet searching but when i execute this code it shows the error that the "aspriseOCR.dll" file was not found but when i have no idea about how the dll file for this code is create please help me by providing some code for the following functions so that if does not show the above error
.................................................. .................................................. ....... -
Option Explicit
-
Private Declare Function OCR Lib "AspriseOCR.dll" (ByVal file As String, ByVal imageType As Long) As String
-
Private Declare Function OCRBarCodes Lib "AspriseOCR.dll" (ByVal file As String, ByVal imageType As Long) As String
-
Private Declare Function OCRpart Lib "AspriseOCR.dll" (ByVal file As String, ByVal imageType As Long, ByVal startX As Long, ByVal startY As Long, ByVal width As Long, ByVal height As Long) As String
-
-
Private Sub Check1_Click()
-
If Check1.Value = Checked Then
-
Command4.Enabled = True
-
Else
-
Command4.Enabled = False
-
End If
-
End Sub
-
-
Private Sub Command1_Click()
-
Dim fnum As Integer
-
-
On Error Resume Next
-
dlgOpenFile.ShowOpen
-
If Err.Number = cdlCancel Then
-
' The user canceled.
-
Exit Sub
-
ElseIf Err.Number <> 0 Then
-
' Unknown error.
-
MsgBox "Error " & Format$(Err.Number) & _
-
" selecting file." & vbCrLf & _
-
Err.Description
-
Exit Sub
-
End If
-
On Error GoTo 0
-
-
' Read the file.
-
'fnum = FreeFile
-
'Open dlgOpenFile.FileName For Input As #fnum
-
'text.text = Input$(LOF(fnum), fnum)
-
'Close #fnum
-
-
textPath.text = dlgOpenFile.FileNameEnd Sub
-
-
Private Sub Command2_Click()
-
Dim ret As String
-
ret = OCR(textPath.text, -1)
-
text.text = ret
-
End Sub
-
-
Private Sub Command3_Click()
-
Dim ret As String
-
ret = OCRBarCodes(textPath.text, -1)
-
text.text = ret
-
End Sub
-
-
Private Sub Command4_Click()
-
Dim ret As String
-
ret = OCRpart(textPath.text, -1, CLng(X.text), CLng(Y.text), CLng(W.text), CLng(H.text))
-
text.text = ret
-
End Sub
-
-
Private Sub Command5_Click()
-
End
-
End Sub
-
-
Private Sub Form_Load()
-
dlgOpenFile.InitDir = App.Path
-
dlgOpenFile.DialogTitle = "Open File"
-
dlgOpenFile.Flags = _
-
cdlOFNFileMustExist + _
-
cdlOFNHideReadOnly + _
-
cdlOFNLongNames + _
-
cdlOFNExplorer
-
dlgOpenFile.CancelError = True
-
Command4.Enabled = False
-
End Sub
.................................................. ...
If you are trying to create a program like OmniPage, you have an enormous task. The characters that you see in an image file are just composed of dots called pixels, there are no ascii characters. Plus, image file formats are pretty tough. HTH --Sam
The referenced AspriseOCR.dll is not part of VB 6.0 . that is some thirdparty file. You need to have that file in your system to use that.
hello expert
i download this file with the code but it is not working with programe
where i will save this file or can i create my own dll file for this code if yes
then give some tips about it
thanks
The referenced AspriseOCR.dll is not part of VB 6.0 . that is some thirdparty file. You need to have that file in your system to use that.
1.copy the file to SYSTEM32 folder
2.register the dll with windows using REGSVR32 key.
then try to use the control.
For a Declare statement, I don't think you need to register the DLL. I would recommend copying it into the same directory as your program first, to try it out. But make sure you start VB in that directory, so it is the current one.
You are crazy!
Try to make a DLL and save in the same folder where VB is installed or just
browse from the VB.
VACE
You are crazy!
Try to make a DLL ...
Um... which of us are you responding to, VACEPROGRAMER?
I'm reponding to veer!!
VACE
please responding me about my question
I'm reponding to veer!!
VACE
I thought we were waiting on more detail of the latest problem. "Not working" doesn't really tell us very much.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Phil Powell |
last post by:
I have a PHP script that would read in a binary file and display it as if it
were <img src>, how would you do that w/o changing the header's MIME type?
The entire file does not need to be changed....
|
by: Randy Webb |
last post by:
Running Apache2 and PHP 4.3.3 on Windows, is there any way that I can
have PHP read an image file and out put its color content?
Preferably, I would like for it to read a .bmp file and output a...
|
by: Socrates |
last post by:
I am interested in developing an online utility that will enable users
to
copy and past any image (or upload any image on the internet) to the
online utility, which will then convert the image to...
|
by: nicolasg |
last post by:
Hi,
I'm trying to open a file (any file) in binary mode and save it inside
a new text file.
After that I want to read the source from the text file and save it
back to the disk with its...
|
by: dba123 |
last post by:
I need help in coding the following or if you can just point me in the right
direction:
1) Reading the follwoing XML document
2) Hook up a GridView to the data received from the XML document. ...
|
by: paraidy |
last post by:
Hi all, as from object i need to read all byte from a file example c:
\myphoto.jpg and recreate the file with another name to another
directory c:\photo\recreatedphoto.jpg can someone write a...
|
by: =?Utf-8?B?ZGF2aWQ=?= |
last post by:
I try to follow Steve's paper to build a database, and store a small text
file into SQL Server database and retrieve it later. Only difference between
my table and Steve's table is that I use NTEXT...
|
by: ecpbm765 |
last post by:
Hey,
I am helping to develop a project that displays images based on user
input. One possible way of implementing this is via a widget that
when it is run, would read in the users input from an...
|
by: sam |
last post by:
same as subject?
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |