You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > 1D Barcode Recognition Extension > Barcode1DReaderGetBarcodeType Method
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.Barcode1DReaderGetBarcodeType Method

Returns the type of a barcode detected by the Barcode1DReaderDoScan function.

C#
public Barcode1DReaderType Barcode1DReaderGetBarcodeType(
    int BarcodeNo
);
Visual Basic
Public Function Barcode1DReaderGetBarcodeType(
    ByVal BarcodeNo As Integer
) As Barcode1DReaderType
Parameters
Parameters 
Description 
BarcodeNo 
Barcode index. Must be between 1 and Barcode1DReaderGetBarcodeCount returned value. 
Returns

A member of the Barcode1DReaderType enumeration.

This function requires the optional GdPicture 1D Barcode Recognition Plugin. This Plugin must be unlocked with the SetLicenseNumber1DBarcodeRecognition() function.

Detecting all barcode of an image 

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
   Dim oGdPictureImaging As New GdPicture.GdPictureImaging
   Dim ImageID As Integer
 
   oGdPictureImaging.SetLicenseNumber("XXX") 'Unlocking GdPicture.NET -> Replace XXX by a valid license KEY
   oGdPictureImaging.SetLicenseNumber1DBarcodeRecognition("XXX") 'Unlocking the optional GdPicture 1D Barcode Recognition Plugin -> Replace XXX by a valid license KEY
 
   ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("") 'Prompt the user to select an image
 
   If ImageID <> 0 Then
       If oGdPictureImaging.Barcode1DReaderDoScan(ImageID) = GdPictureStatus.OK Then 'Start barcode scanning process
           Dim BarcodeCount As Integer = oGdPictureImaging.Barcode1DReaderGetBarcodeCount
 
           If BarcodeCount > 0 Then
               For i As Integer = 1 To BarcodeCount
                   MsgBox("Barcode No: " & Str(i))
                   MsgBox("Type: " & oGdPictureImaging.Barcode1DReaderGetBarcodeType(i).ToString)
                   MsgBox("Value: " & oGdPictureImaging.Barcode1DReaderGetBarcodeValue(i))
                   MsgBox("Angle: " & Str(oGdPictureImaging.Barcode1DReaderGetBarcodeSkewAngle(i)))
               Next
           Else
               MsgBox("No barcode detected !")
           End If
 
           oGdPictureImaging.Barcode1DReaderClear() 'Release detection info from memory
       End If
       oGdPictureImaging.ReleaseGdPictureImage(ImageID)
   End If
End Sub
What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.