Look for barcodes within the specified image. Only 24 bit RGB and 8 bit gray scale images are supported.
Returns a list of detected barcodes as TIEVisionBarCodeSymbol objects.
Parameter
Description
image
Image where to search for barcodes
rect
Rectangle of the image where to search for. Setting (0, 0, 0, 0) means the whole image
Note: There is also a shortcut method available: ScanBarcode
// Method to read a barcode from a file function ReadBarcodeFromFile(const Filename : string): String; var IEBitmap: TIEBitmap; begin Result := ''; IEBitmap := TIEBitmap.Create; try IEBitmap.LoadFromFile( Filename ); m_symbols := IEVisionLib.createBarCodeScanner().scan( IEBitmap.GetIEVisionImage(), IEVisionRect( 0, 0, 0, 0 ));
if m_symbols.size() > 0 then Result := TIEVisionBarCodeSymbol( m_symbols.getObj( m_symbols.size() - 1 )).getData().c_str(); finally IEBitmap.Free; end; end;
// Method to read a barcode from a bitmap function ReadBarcodeFromBitmap(aBitmap: TBitmap): String; var IEBitmap: TIEBitmap; begin IEBitmap := TIEBitmap.Create( aBitmap, Rect( 0, 0, aBitmap.Width, aBitmap.Height )); try m_symbols := IEVisionLib.createBarCodeScanner().scan( IEBitmap.GetIEVisionImage(), IEVisionRect( 0, 0, 0, 0 ));
if m_symbols.size() > 0 then Result := TIEVisionBarCodeSymbol( m_symbols.getObj( m_symbols.size() - 1 )).getData().c_str(); finally IEBitmap.Free; end; end;