SetScanRect - specify the rectangle to search within an image
Syntax
.net/com/java/ocx: SetScanRect(tlx, tly, brx, bry, mode)
dll: mtSetScanRect(hBarcode, tlx, tly, brx, bry, mode)
Parameters
hBarcode Handle to an instance of the barcode toolkit (dll only).
tlx x coordinate of top left hand corner
tly y coordinate of top left hand corner
brx x coordinate of bottom right hand corner
bry y coordinate of bottom right hand corner
mode mapping mode (see below)
Return Value
1/True on success and 0/False on failure.
Remarks
SetScanRect specifies the bounding rectangle in the image that should be searched for barcodes. To clear the rectangle and search the entire image set the rectangle to (-1, -1, -1, -1). The top left hand corner of an image is (0,0).
The mapping mode can have the following values:
0 = All measurements are in pixels.
1 = All measurements are a percentage of the width or height of the image.
Win32 dll declarations:
VB.Net:
Private Declare Function mtSetScanRect Lib “SoftekBarcode” (ByVal hBarcode As System.IntPtr, ByVal TopLeftX As Integer, ByVal TopLeftY As Integer, ByVal BottomRightX As Integer, ByVal BottomRightY As Integer, ByVal MappingMode As Short) As Boolean
Visual C++:
extern “C” {
BOOL __stdcall mtSetScanRect(HANDLE hBarcode, long TopLeftX, long TopLeftY, long BottomRightX, long BottomRightY, short MappingMode);
}