GdPicture.NET Reference Guide
Barcode1DReaderGetBarcodeX3 Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : Barcode1DReaderGetBarcodeX3 Method
Barcode index. Must be between 1 and Barcode1DReaderGetBarcodeCount returned value.
Returns the X position (in pixels) of the bottom-right corner of a barcode detected by the Barcode1DReaderDoScan method. If ROI has been set, this coordinate is relative to the used ROI.
Syntax
'Declaration
 
Public Function Barcode1DReaderGetBarcodeX3( _
   ByVal BarcodeNo As Integer _
) As Integer
public int Barcode1DReaderGetBarcodeX3( 
   int BarcodeNo
)
public function Barcode1DReaderGetBarcodeX3( 
    BarcodeNo: Integer
): Integer; 
public function Barcode1DReaderGetBarcodeX3( 
   BarcodeNo : int
) : int;
public: int Barcode1DReaderGetBarcodeX3( 
   int BarcodeNo
) 
public:
int Barcode1DReaderGetBarcodeX3( 
   int BarcodeNo
) 

Parameters

BarcodeNo
Barcode index. Must be between 1 and Barcode1DReaderGetBarcodeCount returned value.

Return Value

The barcode X position of the bottom-right corner; relative to the ROI, if any is defined.
Remarks
This method is used in the "Barcode Recognition" Demo.
Example
Detecting all barcodes in an image and drawing a rectangle around them.
Dim oGdPictureImaging As New GdPicture.GdPictureImaging
Dim ImageID As Integer = 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
            MessageBox.show("Barcode No: " & Str(i))
            MessageBox.show("Type: " & oGdPictureImaging.Barcode1DReaderGetBarcodeType(i).ToString)
            MessageBox.show("Value: " & oGdPictureImaging.Barcode1DReaderGetBarcodeValue(i))
            MessageBox.show("Angle: " & Str(oGdPictureImaging.Barcode1DReaderGetBarcodeSkewAngle(i)))
         Next
         Dim X1, X2, X3, X4, Y1, Y2, Y3, Y4 As Integer
         'LeftArea, TopArea are coordinates used by SetROI()
         For i = 1 To oGdPictureImaging.Barcode1DReaderGetBarcodeCount()
            X1 = oGdPictureImaging.Barcode1DReaderGetBarcodeX1(i) + LeftArea
            X2 = oGdPictureImaging.Barcode1DReaderGetBarcodeX2(i) + LeftArea
            X3 = oGdPictureImaging.Barcode1DReaderGetBarcodeX3(i) + LeftArea
            X4 = oGdPictureImaging.Barcode1DReaderGetBarcodeX4(i) + LeftArea
            Y1 = oGdPictureImaging.Barcode1DReaderGetBarcodeY1(i) + TopArea
            Y2 = oGdPictureImaging.Barcode1DReaderGetBarcodeY2(i) + TopArea
            Y3 = oGdPictureImaging.Barcode1DReaderGetBarcodeY3(i) + TopArea
            Y4 = oGdPictureImaging.Barcode1DReaderGetBarcodeY4(i) + TopArea
            oGdPictureImaging.DrawLine(ImageID, X1, Y1, X2, Y2, 1, Color.Red, True)
            oGdPictureImaging.DrawLine(ImageID, X2, Y2, X3, Y3, 1, Color.Red, True)
            oGdPictureImaging.DrawLine(ImageID, X3, Y3, X4, Y4, 1, Color.Red, True)
            oGdPictureImaging.DrawLine(ImageID, X4, Y4, X1, Y1, 1, Color.Red, True)
         Next
      Else
         MessageBox.show("No barcode detected !")
      End If
      oGdPictureImaging.Barcode1DReaderClear() 'Release detection info from memory
   End If
   oGdPictureImaging.ReleaseGdPictureImage(ImageID)
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members