To your scanner doesn't have barcode engine, we suggest to use our GdPicture 1D Barcode Recognition Plugin: https://www.gdpicture.com/products/plugi ... nition.php
Code: Select all
Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command4.Click
Dim ImageID As Integer
Dim oGdPictureImaging As New GdPicture.GdPictureImaging
oGdPictureImaging.SetLicenseNumber("XXX") 'Replace XXX by a valid demo or commercial license KEY
If oGdPictureImaging.TwainOpenDefaultSource(Me.Handle) Then
If oGdPictureImaging.TwainIsBarcodeDetectionAvailable Then
oGdPictureImaging.TwainSetBarcodeDetection(True)
ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
If ImageID <> 0 Then
Dim BarCodeCount As Integer = oGdPictureImaging.TwainBarCodeGetCount
MsgBox(Str(BarCodeCount) + " barcode have been found in the scanned image")
For i As Integer = 1 To BarCodeCount
MsgBox("Type of barcode " + Str(i) + " is: " + oGdPictureImaging.TwainBarCodeGetType(i).ToString)
MsgBox("Value of barcode " + Str(i) + " is: " + oGdPictureImaging.TwainBarCodeGetValue(i))
Next
Call oGdPictureImaging.ReleaseGdPictureImage(ImageID)
End If
Else
MsgBox("Error: Barcode detection is not available on this scanner")
End If
Call oGdPictureImaging.TwainCloseSource()
MsgBox("Done !")
Else
MsgBox("can't open default source, twain state is: " & oGdPictureImaging.TwainGetState.ToString)
End If
End Sub