Barcode Reader & Decoder Software

Home arrow Barcode Recognition SDK arrow More Info arrow Methods
Home
 
Barcode Recognition SDK
 
 
Barcode Scanner
 
Document Processor
 
Buy Now
  
FAQs
 
Support
 
OnLine Barcode Decoder

Our Barcode Creation Tools:
www.BarcodeTools.com

On-Line Barcode Generator:
www.bcmaker.com

Barcode Generator
BarcodeDecoder Methods


AboutBox Method
Opens an About window.

Syntax
object.AboutBox()
Return Value
No return value.



DecodeFile Method
Decodes barcodes in the specified image file.

Syntax
object.DecodeFile(FileName)
Parameters
FileNameA string defining the file name.
Return Value
Integer. Returns the number of decoded barcodes.
Example
[Script]

var dec = new ActiveXObject("BarcodeReader.BarcodeDecoder");
var objBarcode;
dec.DecodeFile("c:\\barcodes.jpg");
for (var i=0; i < dec.Barcodes.length; i++)
{
  objBarcode = dec.Barcodes.item(i);
  alert(objBarcode.Text);
}

[Visual Basic]

Dim dec As Object
Set dec = CreateObject("BarcodeReader.BarcodeDecoder")

dec.DecodeFile ("c:\barcodes.jpg")

For i = 0 To dec.Barcodes.length - 1
   Dim bc As Barcode
   Set bc = dec.Barcodes.Item(i)
   MsgBox bc.Text
Next i

Set dec = Nothing

[C/C++]

//creates the barcode decoder object
CComPtr<IBarcodeDecoder> pIBarcodeDecoder;
HRESULT hr = pIBarcodeDecoder.CoCreateInstance( 
  _T("BarcodeReader.BarcodeDecoder") );
_ASSERTE( SUCCEEDED(hr) );

hr = pIBarcodeDecoder->DecodeFile( _bstr_t("c:\\barcodes.jpg") );
_ASSERTE( SUCCEEDED(hr) );



DecodeFileRect Method
Similar to the DecodeFile method, but searches only a certain part of the image defined by the parameters x, y, width, height.

Syntax
object.DecodeFileRect(FileName, x, y, width, height)
Parameters
FileNameA string defining the file name.
xAn integer value that defines the X coordinate of scanning zone.
yAn integer value that defines the Y coordinate of scanning zone.
widthAn integer that defines the width of scanning zone.
heightAn integer that defines the height scanning zone.
Return Value
Integer. Returns the number of decoded barcodes.



DecodeStream Method
Similar to the DecodeFile method, but a file in the form of a data stream is passed as a parameter. Everything that is contained in the image file is passed as a data stream.

Syntax
object.DecodeStream(FileStream)
Parameters
FileStreamA Variant that contains a safe array of Bytes.
Return Value
Integer. Returns the number of decoded barcodes.
Remarks
This method is convenient when there is no need to save the barcode image to a file, for instance, while decoding barcodes from some video capture device.



DecodeStreamRect Method
Similar to the DecodeStream method, but searches only a certain part of the image defined by the parameters x, y, width, height.

Syntax
object.DecodeStreamRect(FileStream, x, y, width, height)
Parameters
FileStreamA Variant that contains a safe array of Bytes.
xAn integer value that defines the X coordinate of scanning zone.
yAn integer value that defines the Y coordinate of scanning zone.
widthAn integer that defines the width of scanning zone.
heightAn integer that defines the height scanning zone.
Return Value
Integer. Returns the number of decoded barcodes.



DecodeGrayMap Method
This method finds barcodes in a raw gray map. It is the fastest method as compared to the other methods because no additional image transformations are performed in this case.

Syntax
object.DecodeGrayMap(GrayMap, GrayMapWidth, GrayMapHeight)
Parameters
GrayMapA Variant that contains a safe array of Bytes.
GrayMapWidthGray map width.
GrayMapHeightGray map height.
Return Value
Integer. Returns the number of decoded barcodes.
Remarks
A gray map is a byte matrix. Each byte has the value from 0 to 255 and represents one image pixel.
0 means a black pixel, 255 means a white pixel.
The matrix is passed to the DecodeGrayMap method as a one-dimensional array. The first upper line of the image is sent first, then comes the second line and so on.
See the picture below for explanation.

Decode barcodes from raw gray map stream
Example
[C/C++]

const BYTE pgm[6300] = {
  0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0, //...
};

//creates the barcode decoder object
CComPtr<IBarcodeDecoder> pIBarcodeDecoder;
HRESULT hr = pIBarcodeDecoder.CoCreateInstance( 
  _T("BarcodeReader.BarcodeDecoder") );
_ASSERTE( SUCCEEDED(hr) );

//creates the safe array
CComVariant var;
var.vt = VT_ARRAY | VT_UI1;
var.parray = SafeArrayCreateVector( VT_UI1, 0, sizeof(pgm) );
_ASSERTE( var.parray );

//locks the safe array
BYTE* pSaBuf=NULL;
if( SUCCEEDED(SafeArrayAccessData(var.parray, (void HUGEP**)&pSaBuf)) )
{
   //copy the image into the safe array
   memcpy( pSaBuf, pgm, sizeof(pgm) );
   //unlock safe array
   SafeArrayUnaccessData( var.parray );
}

hr = pIBarcodeDecoder->DecodeGrayMap( var, 105, 60 );



DecodeGrayMapRect Method
Similar to the DecodeGrayMap method, but searches only a certain part of the image defined by the parameters x, y, width, height.

Syntax
object.DecodeGrayMapRect(GrayMap, GrayMapWidth, GrayMapHeight,
  x, y, width, height)
Parameters
GrayMapA Variant that contains a safe array of Bytes.
GrayMapWidthGray map width.
GrayMapHeightGray map height.
xAn integer value that defines the X coordinate of scanning zone.
yAn integer value that defines the Y coordinate of scanning zone.
widthAn integer that defines the width of scanning zone.
heightAn integer that defines the height scanning zone.
Return Value
Integer. Returns the number of decoded barcodes.



SetProperty Method
It sets additional Barcode Decoder object properties. The input parameter PropertyValue is VARIANT, it can take data of various types depending on the PropertyName parameter.

Syntax
object.SetProperty(PropertyName, PropertyValue)
Parameters
PropertyNameString that defines the property name.
PropertyValueVariant that contains the property value.


PropertyNameDescription
FrameTimeTime to decode 1 frame in milliseconds.
Default value - 0 (unlimited).
DecodePageNumberthe number of the page to be recognized. This property works only for multipage files, e.g. TIFF, PDF. If this page does not exist in the file, an error will be returned during the decoding process. Default value - 0 (decode all pages).
AddFilter1Filter binary scanning noise like this. Usually don't need to use this filter but it may need when image too distorted by this noise type.
AddFilter2Filter binary scanning noise like this.
Filter2ValueFilter 2 parameter. Recommended 0.5 - 1.5 (default 1).
BlurringRectthe rect for blurring measure. This is string value like "0;10;150;100;" (where: 0-left, 10-top, 150-right, 100-bottom).
Default value - "0;0;0;0;" (don't measure).
BlurringValuethe integer value of blurring if BlurringRect is determined. You can get this value after calling one of Decode___ method.
BlurringCalccalculate the blurring value of decoded barcode (default - false).
LinearInterl25MinLenthe minimum length of an Interleaved 2/5 barcode. If the length of a read barcode is less than this value, the barcode is considered unrecognized.
Default value - 2
LinearInterl25MaxLenthe maximum length of an Interleaved 2/5 barcode. If the length of a read barcode is greater than this value, the barcode is considered unrecognized.
Default value - 50
LinearIndustr25MinLensame as LinearInterl25MinLen only for Industrial 2/5 barcode
Default value - 1
LinearIndustr25MaxLensame as LinearInterl25MaxLen only for Industrial 2/5 barcode
Default value - 50
LinearCode11MinLenDefault value - 1
LinearCode11MaxLenDefault value - 50
LinearCode39MinLenDefault value - 1
LinearCode39MaxLenDefault value - 50
LinearCode128MinLenDefault value - 1
LinearCode128MaxLenDefault value - 70
LinearCodabarMinLenDefault value - 1
LinearCodabarMaxLenDefault value - 50
LinearFindErrorBarcodessearch for linear barcodes that have not been recognized for some reason. For example, corrupted, partially closed, etc. Example here.
Default value - false
LinearBarcodesPerPagehow many linear barcodes to search for on each page. By default, this value is 0, i.e. search for all barcodes on each page. If the number of found barcodes equals to LinearFindBarcodes, the search is stopped.
Default value - 0
LinearFastDecodingquick Linear barcode reading. It may be used on real-time barcode reading devices (mobile devices), where it is impossible to spend much time on recognition of poor-quality images. It is not recommended to set this property for image recognition on non-mobile devices. Default value - 0 (Normal). Possible values:
0 - Normal
1 - Fast
2 - Slow
LinearVerifyVerify linear barcode after decoding. Improves reliability linear barcode reading. Default value - False (don't verify).
PDF417BarcodesPerPagehow many PDF417 barcodes to search for on each page. By default, this value is 0, i.e. search for all barcodes on each page.
Default value - 0
PDF417FindBarcodeshow many PDF417 barcodes to search for in the entire document.
Default value - 1
PDF417FastDecodingsame as LinearFastDecoding only for PDF417.
PDF417SymbologyIDthe value determining whether to add Symbology ID to the barcode text or not.
Default value - false
PDF417FindMicroFinds Micro PDF417 barcodes.
Default value - false
PDF417RobustActivates the robust PDF417 decoder mode. This property can help to decode high distorted PDF417 barcodes.
Default value - false
DataMatrixBarcodesPerPagehow many DataMatrix barcodes to search for on each page. By default, this value is 0, i.e. search for all barcodes on each page.
Default value - 0
DataMatrixFindBarcodeshow many DataMatrix barcodes to search for in the entire document.
Default value - 1
DataMatrixFastDecodingsame as LinearFastDecoding only for DataMatrix.
DataMatrixInverseTypewhat barcodes should be decoded (darks on light or lights on dark).
Default value - darks on light
DataMatrixSupportECIsupport or not ECI (Extended Channel Interpretation).
Default value - false
DataMatrixSymbologyIDthe value determining whether to add Symbology ID to the barcode text or not.
Default value - false
QRCodeBarcodesPerPagehow many QRCode barcodes to search for on each page. By default, this value is 0, i.e. search for all barcodes on each page.
Default value - 0
QRCodeFindBarcodeshow many QRCode barcodes to search for in the entire document.
Default value - 1
QRCodeFastDecodingsame as LinearFastDecoding only for QRCode.
QRCodeSymbologyIDthe value determining whether to add Symbology ID to the barcode text or not.
Default value - false
QRCodeFindMicroFinds Micro QRCode barcodes.
Default value - false
AztecCodeBarcodesPerPagehow many AztecCode barcodes to search for on each page. By default, this value is 0, i.e. search for all barcodes on each page.
Default value - 0
AztecCodeFindBarcodeshow many AztecCode barcodes to search for in the entire document.
Default value - 1
AztecCodeFastDecodingsame as LinearFastDecoding only for AztecCode.
AztecCodeSymbologyIDthe value determining whether to add Symbology ID to the barcode text or not.
Default value - false
VideoDelayAfterDecThe pause (in milliseconds) in decoding after barcode has been found.
Default value - 1000 (1 second)
VideoDelayFrameThe pause (in milliseconds) between frames.
Default value - 0 (no pause)
VideoDelayRedrawThe pause (in milliseconds) between frames redrawing.
Default value - 0 (no pause)
VideoStretchStretch or not image on control size.
Default value - 0 (doesn't stretch)
VideoBeepBeep or not after barcode.
Default value - 1 (beep)
Return Value
No return value.
Example
[Visual Basic]

Dim dec As Object
Set dec = CreateObject("BarcodeReader.BarcodeDecoder")

dec.BarcodeTypes = dec.BarcodeTypes Or &H20000000 'add PDF417
Call dec.SetProperty("PDF417FindBarcodes", 3)

dec.DecodeFile ("c:\pdf417.bmp")

For i = 0 To dec.Barcodes.length - 1
   Dim bc As Barcode
   Set bc = dec.Barcodes.Item(i)
   MsgBox bc.Text
Next i

Set dec = Nothing



GetProperty Method
Returns the properties set with the SetProperty method.

Syntax
object.GetProperty(PropertyName)
Parameters
PropertyNameString that defines the property name.
Read only parameters
GetErrorLinearReturns last error code of Linear decoder.
GetErrorPDF417Returns last error code of PDF417 decoder.
GetErrorDataMatrixReturns last error code of DataMatrix decoder.
GetErrorQRCodeReturns last error code of QRCode decoder.
GetErrorAztecCodeReturns last error code of AztecCode decoder.
Return Value
Variant. Returns the property value.



GetSDKInfo Method
Returns various SDK information.

Syntax
object.GetSDKInfo(Version, Edition, Symbology, buildDate, LicenseInfo, expDate, hwID)
Parameters
VersionReturns String that defines SDK version. "5.02" for example.
EditionReturns Integer that defines SDK edition. 1 - Standard Edition, 2 - Professional Edition.
SymbologyReturns Integer that defines what barcodes types can decode this instance of SDK.
1 - Linear Barcode
2 - PDF417
4 - DataMatrix
8 - QRCode
16 - Aztec Code
Symbology value can combine (binary OR operation) different barcode types. For example: 3 - means Linear+PDF417, 1 - only Linear, 24 - QRCode+Aztec.
buildDateReturns DATE (double) that defines SDK building date.
LicenseInfoReturns String that defines the license owner. If this value is null or empty then SDK works in demo mode.
expDateexpDate returns the DATE (double value) on which the subscription will expire. All SDKs released before this date (whose buildDate is less than the expDate) will work without any limitations. Newer versions released after the expDate will work only in demo mode.
If expDate is -1 then subscription expired.
hwIDReturns hardware ID used in SDK.
Return Value
No return value.



VideoStart Method
Starts barcode decoding from video input device. To see video set ShowImage property.

Syntax
object.VideoStart(cameraID, frameWidth, frameHeight)
Parameters
cameraIDVideo device number (0 is first device).
frameWidthRequired frame width.
frameHeightRequired frame height.
Return Value
No return value.
Remarks
If frameWidth or frameHeight is 0 then SDK selects the maximum frame resolution. If the device doesn't not support the required frameWidthxframeHeight format then SDK selects nearest format.



VideoStop Method
Stops decoding from video input device.

Syntax
object.VideoStop()
Return Value
No return value.



VideoSuspend Method
Suspends or resume video decoding.

Syntax
object.VideoSuspend(Suspend)
Parameters
SuspendA Boolean type to determine video suspending.
Return Value
No return value.



 
Barcode Recognition SDK
version 5.60
Latest release: March 6 2017
What's new in SDK

Platforms:

Windows 32-bit & 64-bit
Windows 10 (UWP)
Windows Phone 8/8.1
Windows Mobile
Android
Linux
Raspberry Pi
Mac OS
iPhone
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, DataBar Omnidirectional (RSS-14), DataBar Truncated (RSS-14 Truncated), DataBar Limited (RSS Limited), DataBar Stacked, DataBar Expanded, DataBar Expanded Stacked.
2D:
PDF417 (Compact, Micro)
QRCode, Micro QRCode
DataMatrix
Aztec Code

Download


Free Barcode Recognition Application
Free Demo Application
Download Now
Windows Barcode Scanner
Windows Barcode Scanner
Download Now

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