ScanBarCodeFromBitmap - scan a bitmap for barcodes
Syntax
.net: Object.ScanBarCodeFromBitmap(bitmap)
.net/com/ocx: Object.ScanBarCodeFromBitmap(hBitmap)
dll: mtScanBarCodeFromBitmap(hBarcode, hBitmap)
Parameters
hBarcode Handle to an instance of the barcode toolkit (dll only).
bitmap System.Drawing.Bitmap object
hBitmap handle (HBITMAP) to a bitmap.
Return Value
-1 N/A
-2 Bitmap is multi-plane
-3 Invalid number of bits per sample
-4 Memory allocation error
-5 N/A
-6,-7,-8 Invalid license key.
Remarks
Scan the specified device dependent bitmap for bar code strings and return the number of bar codes found. The image must be single plane. Note that hBitmap is a HANDLE to a BITMAP, not the address of a BITMAP structure. The Windows GDI function, CreateBitmapIndirect can be used to create an HBITMAP from a BITMAP structure. Note that the function will stop when the first barcode is found in a document unless the MulipleRead property is set to True.
The managed component supports 2 forms of this function:
ScanBarCodeFromBitmap(IntPtr hBitmap)
ScanBarCodeFromBitmap(System.Drawing.Bitmap bitmap) (Managed Component Only)
Scan the specified managed bitmap object for bar code strings and return the number of bar codes found.
See also: ScanBarcodeFromDIB
Photometric
Win32 dll declarations:
VB.Net:
Private Declare Function mtScanBarCodeFromBitmap Lib “SoftekBarcode” (ByVal hBarcode As System.IntPtr, ByVal hBitmap As IntPtr) As Short
Visual C++:
extern “C” {
short __stdcall mtScanBarCodeFromBitmap(HANDLE hBarcode, long hBitmap);
}