GetBarStringPos - position and page number for a barcode
Syntax
.net:
System.Drawing.Rectangle Object.GetBarStringRect(n)
Object.GetBarStringPage(n)
com:
Object.BarStringPage(n)
Object.BarStringTopLeftX(n)
Object.BarStringTopLeftY(n)
Object.BarStringBottomRightX(n)
Object.BarStringBottomRightY(n)
ocx:
pageNo = Object.GetBarStringPos(n, &TopLeftX &TopLeftY, &BottomRightX, &BottomRightY)
dll:
pageNo = mtGetBarStringPos(hBarcode, n, &TopLeftX, &TopLeftY, &BottomRightX, &BottomRightY)
Parameters
hBarcode Handle to an instance of the barcode toolkit (dll only).
n 1-based index to barcode to be queried.
TopLeftX variable to receive x coordinate of the top left hand corner of rectangle
TopLeftY variable to receive x coordinate of the top left hand corner of rectangle
BottomRightX variable to receive x coordinate of the bottom right hand corner of rectangle
BottomRightY variable to receive y coordinate of the bottom right hand corner of rectangle
Return value
GetBarStringRect returns a System.Drawing.Rectangle object.
GetBarStringPage, GetBarStringPos, mtGetBarStringPos and BarStringPage return the page number (indexed from 1) for the barcode.
BarStringTopLeftX etc return the coordinates of the dounding rectangle.
Remarks
GetBarStringPos and the related group of functions are used to obtain the page number and bounding rectangle of a barcode. The methods available and the way in which they are called differ from interface to interface. Note that the bounding rectangle only covers the readable area of the barcode and if MultipleRead is set to false it will only cover a portion of the barcode.
In the case of the dll and ocx interfaces, the GetBarStringPos function returns the page number.
Win32 dll declarations:
VB.Net:
Private Declare Function mtGetBarStringPos Lib “SoftekBarcode” (ByVal hBarcode As System.IntPtr, ByVal nBarCode As Short, ByRef TopLeftX As Integer, ByRef TopLeftY As Integer, ByRef BottomRightX As Integer, ByRef BottomRightY As Integer) As Short
Visual C++:
short __stdcall mtGetBarStringPos(HANDLE hBarcode, short nBarCode, long FAR* pTopLeftX, long FAR* pTopLeftY, long FAR* pBotRightX, long FAR* pBotRightY);