ReadAllDataMatricesOnImage

#include "BIBRDM.H"

 

HANDLE CALLBACK ReadAllDataMatricesOnImage (
HANDLE    hDIB,
LPRECT            pDataMatrixRect,
int                       MinimalCellSize,
int                       MinimalQuietZoneSize,
int *                    BarCodeNum,
int *                    iErrorCode)

Description

The ReadAllDataMatricesOnImage function searches and decodes all data matrices within the region of the input image specified in the parameters and returns a DataMatrix struct HANDLE. This function works for only monochrome, 8 bit per pixel and 24 bit per pixel images. (The 8 bit per pixel and 24 bit per pixel images are converted into monochrome, using adaptive thresholding method.)  Use GlobalLock to get the struct array elements. The decoded string in the DataMatrix struct is also a HANDLE, use GlobalLock as well, to get the string. A strongly skewed data matrix needs a larger QuietZoneSize to decode. This function will use the Peterson-Gorenstein-Zierler algorithm to detect and repair damaged codewords.

For more information see Data Matrix Searching.

Parameters

HANDLE

hDIB

Handle of the input DIB.

LPRECT

pDataMatrixRect

A rectangle specifying the area of the image where the barcode is. If all of the pRect values are zero, or pRect is NULL, the whole image is scanned.

int

MinimalCellSize

This parameter specifies the minimal cell size in pixels should search on the image. If the used cell size is not known, use 0 value.

int

MinimalQuietZoneSize

This parameter specifies the minimal quiet zone  in pixels size should search on the image.

int *

BarCodeNum

An integer buffer where the number of detected data matrices is written into. The buffer must be allocated and freed up by the user.

int *

iErrorCode

iErrorCode is an integer buffer where the code of occurred error is to written out. The buffer must be allocated and freed up by the user. For possible values see Data Matrix Reading Error Codes.

Return values

This function returns an array of DataMatrixStruct values. The returned array contains BarCodeNum number of values. The array is allocated by the function. Use ReleaseDataMatrixStruct to free up the array. Use GlobalLock to access the array values.

Programming notes

Requirements

Header :     Declared in BIBrDM.h; include BIBrDM.h.

Library :    Use BIBrDM.lib (32 bit version) or BIBrDMx.lib (64 bit version).

DLLs :       BIBrDM.dll (32 bit version) or BIBrDMx.dll (64 bit version).