BarcodeTools.com
Professional BarCode Software
Home
Barcode ActiveX
DataMatrix ActiveX
PDF417 ActiveX
Barcode .NET
DataMatrix .NET
PDF417 .NET
Barcode ASP.NET
DataMatrix ASP.NET
PDF417 ASP.NET
ISAPI
CGI
LabelBar(Pro)
Console Apps
Barcode Recognition
Order
FAQs
Flash Tutorials
Support
Barcode Types
Search
Home arrow Barcode Recognition arrow More Info arrow Overview
BarcodeDecoder Overview Print E-mail
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
Properties
BarcodeTypesr/wReturns or sets what types of barcodes should be decoded.
LinearFindBarcodesr/wDetermines how many barcodes should be decoded on the image.
LinearShowSymbologyIDr/wReturns or sets the value determining whether to add Symbology ID to the barcode text or not.
LinearVerifyCheckDigitr/wVerify or not the optional check digit in barcodes.
LinearShowCheckDigitr/wShow the check digit.
LinearShowStartStopr/wShow the start/stop characters.
LinearCode39EnableExtendedr/wdecode Code 39 as Code 39 Extended.
LinearUPCE2UPCAr/wConvert a UPC-E barcode to UPC-A.
ShowImager/wReturns or sets the value determining whether to show the image and the decoded barcodes or not.
FileNamer/wReturns or sets the name of the file you need to decode.
InverseTyper/wReturns or sets what barcodes should be decoded (darks on light or lights on dark).
BarcodeCountrReturns the number of decoded barcodes.
BarcodesrReturns the BarcodeList object that contains the collection of decoded barcodes.

Methods
DecodeFile Decodes barcodes in the specified image file.
DecodeFileRect Decodes a certain part of the image.
DecodeStream Decodes barcodes from image stream.
DecodeStreamRect Decodes a certain part of the image.
DecodeGrayMap Decodes barcodes from gray map stream.
DecodeGrayMapRect Decodes a certain part of the image.



 

  Home   Order   FAQs   Support   Search

Copyright © 1999-2008, RKD Software, All rights reserved.
All trademarks mentioned are the property of their respective owners.