Description
Main barcode recognition object
Example
[Script]
var dec = new ActiveXObject("BarcodeReader.BarcodeDecoder");
var objBarcode;
dec.LinearFindBarcodes = 2;
dec.DecodeFile("c:\\barcodes.jpg");
for (var i=0; i < dec.Barcodes.length; i++)
{
objBarcode = dec.Barcodes.item(i);
alert(objBarcode.Text);
}
[Visual Basic]
'Create a new instance of Barcode Decoder object
Dim dec As Object
Set dec = CreateObject("BarcodeReader.BarcodeDecoder")
dec.BarcodeTypes = &H1 Or &H8 Or &H80 'only Code128, EAN13 and UPCA
dec.ShowImage = False
dec.LinearFindBarcodes = 7
'decode file
dec.DecodeFile ("c:\barcodes.jpg")
'show results
For i = 0 To dec.Barcodes.length - 1
Dim bc As Barcode
Set bc = dec.Barcodes.Item(i)
txt = ""
If bc.BarcodeType = Codabar Then txt = txt & "Codabar"
If bc.BarcodeType = Code11 Then txt = txt & "Code11"
If bc.BarcodeType = Code128 Then txt = txt & "Code128"
If bc.BarcodeType = Code39 Then txt = txt & "Code39"
If bc.BarcodeType = EAN13 Then txt = txt & "EAN13"
If bc.BarcodeType = EAN8 Then txt = txt & "EAN8"
If bc.BarcodeType = Interl25 Then txt = txt & "Interl25"
If bc.BarcodeType = UPCA Then txt = txt & "UPCA"
If bc.BarcodeType = UPCE Then txt = txt & "UPCE"
txt = txt & ": " & bc.Text
txt = txt & " (" & bc.X1 & "," & bc.Y1 & ")," & "(" & bc.X2 & "," & _
bc.Y2 & ")," & "(" & bc.x3 & "," & bc.y3 & ")," & "(" & bc.x4 & _
"," & bc.y4 & ")"
MsgBox txt
Next i
Set dec = Nothing
[C/C++]
#include <crtdbg.h>
#include <atlcomcli.h>
#import "progid:BarcodeReader.BarcodeDecoder" no_namespace
int _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr = ::CoInitialize( NULL );
_ASSERTE( SUCCEEDED(hr) );
CComPtr<IBarcodeDecoder> pIBarcodeDecoder;
hr = pIBarcodeDecoder.CoCreateInstance( __uuidof(BarcodeDecoder) );
_ASSERT( SUCCEEDED(hr) );
pIBarcodeDecoder->put_LinearFindBarcodes( 7 );
hr = pIBarcodeDecoder->DecodeFile( "c:\\barcodes.jpg" );
_ASSERTE( SUCCEEDED(hr) );
CComPtr<IBarcodeList> pIBarcodeList;
hr = pIBarcodeDecoder->get_Barcodes( &pIBarcodeList );
_ASSERTE( pIBarcodeList );
long len;
hr = pIBarcodeList->get_length( &len );
_ASSERTE( pIBarcodeList );
for( long i=0; i < len; ++i )
{
CComPtr<IBarcode> pBarcode;
pBarcode = pIBarcodeList->item( i );
_ASSERTE( pBarcode );
printf( "%s\n", (LPCTSTR)pBarcode->Text );
}
return 0;
}
Members
|
|
|
 |
 |
 |
 |
Barcode Recognition SDK
version 5.06
Latest release: June 21 2010
What's new in SDK
Platforms:
Windows 32-bit & 64-bit, Windows Mobile Symbian (S60)
Supports
Linear:
Interleaved 2/5, Industrial 2/5, Code 39, Code 39 Extended, Codabar, Code 11, Code 128, Code 128 Extended,
EAN/UCC 128, UPC-E, UPC-A, EAN-8, EAN-13, Code 93, Code 93 Extended
2D:
PDF417
DataMatrix
Download
|
 |
 |
 |
 |
|
|