GdPicture.NET Reference Guide
TwainIsBarcodeDetectionAvailable Method (GdPictureImaging)

GdPicture14 Namespace > GdPictureImaging Class : TwainIsBarcodeDetectionAvailable Method
Asks to the opened source if she can support the barcode detection capability.
Public Function TwainIsBarcodeDetectionAvailable() As Boolean
public bool TwainIsBarcodeDetectionAvailable()
public function TwainIsBarcodeDetectionAvailable(): Boolean; 
public function TwainIsBarcodeDetectionAvailable() : boolean;
public: bool TwainIsBarcodeDetectionAvailable(); 
bool TwainIsBarcodeDetectionAvailable(); 

Return Value

Boolean. TRUE if support the barcode detection, FALSE otherwise -> Use TwainGetLastResultCode() and TwainGetLastConditionCode() methods for diagnosing the error.
Before using this method check that the TWAIN state is TWAIN_SOURCE_OPEN (4) To get the TWAIN state, use the TwainGetState() method.
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
      ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
      If imageId <> 0 Then
         Dim BarCodeCount As Integer = oGdPictureImaging.TwainBarCodeGetCount + " barcode has been found in the scanned image")
         For i As Integer = 1 To BarCodeCount
  "Type of barcode " + Str(i) + " is: " + oGdPictureImaging.TwainBarCodeGetType(i).ToString)
  "Value of barcode " + Str(i) + " is: " + oGdPictureImaging.TwainBarCodeGetValue(i))
      End If
   Else"Error: Barcode detection is not available on this scanner")
   End If
   oGdPictureImaging.TwainCloseSource()"Done !")
Else"can't open default source, twain state is: " & oGdPictureImaging.TwainGetState.ToString)
End If
End Sub
See Also


GdPictureImaging Class
GdPictureImaging Members
TwainGetState Method
TwainSetBarcodeDetection Method
TwainIsBarcodeDetectionEnabled Method