First, you need to declare the following functions exposed from the dll:
1. Private Declare Function OCR Lib "AspriseOCR.dll" (ByVal file As
String, ByVal imageType As Long) As String
2. Private Declare Function OCRBarCodes Lib "AspriseOCR.dll" (ByVal
file As String, ByVal imageType As Long) As String
3. 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
Then you can start to call these functions:
1. Private Sub Command2_Click()
2. Dim ret As String
3. ret = OCR(“C:\\ocr.gif”, -1)
4. End Sub
The code below shows a completed VB OCR demo application as shown in the figure.
Partager