GetBarcode
Top  Previous  Next

Description

Returns the character string decoded from a barcode found in the current frame. The following 1D and 2D barcode symbologies are supported: UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2/5, QR Code, DataMatrix, PDF417


Syntax


[VB]
Value=objActiveGige.GetBarcode([ Type ])


[C/C++]
HRESULT GetFeatureArray(short Type, bstr* pValue);


Data Types
[VB]

Type: Integer
Return value: String


Parameters
[C/C++]

Type [in]  
An optional short value specifying the type of the barcode symbology:  
 
0 - All [default]  
Will attempt to decode all supported barcode types.  
1 - Linear  
Will attempt to decode all supported 1D barcode types.  
2 - QR  
Will attempt to decode the QR code.  
3 - DataMatrix  
Will attampt to decode the DataMatrix code.  
4 - PDF417  
Will attempt to decode the PDF417 code.  
 
pValue [out,retval]  
Pointer to the bstr value containing the decoded string.  
 

Return Values


S_OK  
Success  
 

Example


The following VB example continuously analyzes the incoming image frames for all supported barcode types and displays the string decoded:

Private Sub
 Form_Load()
ActiveGige1.Acquire = 
True

End Sub


Private Sub
 ActiveGige1_FrameAcquired()
Label1.Caption = ActiveGige1.GetBarcode()
End Sub



Remarks


To increase the decoding speed, it is recommended to use this method with the Type argument indicating the specific barcode type.

If several barcodes are present in the current frame, ActiveGigE will attempt to decode the first one found, in the top-to-bottom left-to-right order.

Note that this function does not return an error code. If the barcode has not been decoded, the returned string will be empty. If a critical error occur during the decoding, the string will contain one blank (space) character.