GdPicture.NET Reference Guide
TwainIsBarcodeDetectionEnabled Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : TwainIsBarcodeDetectionEnabled Method
Asks to the opened source if the barcode detection capability is enabled or not.
Syntax
'Declaration
 
Public Function TwainIsBarcodeDetectionEnabled() As Boolean
public bool TwainIsBarcodeDetectionEnabled()
public function TwainIsBarcodeDetectionEnabled(): Boolean; 
public function TwainIsBarcodeDetectionEnabled() : boolean;
public: bool TwainIsBarcodeDetectionEnabled(); 
public:
bool TwainIsBarcodeDetectionEnabled(); 

Return Value

Boolean. TRUE if the barcode detection is enabled, FALSE otherwise.
Remarks
Before using this method check that the TWAIN state is TWAIN_SOURCE_OPEN (4) To get the TWAIN state, use the TwainGetState() method.
Example
Acquire single image and detect its barcodes
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
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
         MessageBox.show(Str(BarCodeCount) + " barcode has been found in the scanned image")
         For i As Integer = 1 To BarCodeCount
            MessageBox.show("Type of barcode " + Str(i) + " is: " + oGdPictureImaging.TwainBarCodeGetType(i).ToString)
            MessageBox.show("Value of barcode " + Str(i) + " is: " + oGdPictureImaging.TwainBarCodeGetValue(i))
         Next
         oGdPictureImaging.ReleaseGdPictureImage(ImageID)
      End If
   Else
      MessageBox.show("Error: Barcode detection is not available on this scanner")
   End If
   oGdPictureImaging.TwainCloseSource()
   MessageBox.show("Done !")
Else
   MessageBox.show("can't open default source, twain state is: " & oGdPictureImaging.TwainGetState.ToString)
End If
End Sub
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
TwainGetState Method
TwainSetBarcodeDetection Method
TwainIsBarcodeDetectionAvailable Method