Nicomsoft OCR: Developer's Guide


Blk_GetBarcodeRect


Syntax

C++:int Blk_GetBarcodeRect(HBLK BlkObj, int BarcodeInd, int* Xpos, int* Ypos, int* Width, int* Height)
C#:int Blk_GetBarcodeRect(int BlkObj, int BarcodeInd, out int Xpos, out int Ypos, out int Width, out int Height)
Visual Basic:Function Blk_GetBarcodeRect(ByVal BlkObj As Integer, ByVal BarcodeInd As Integer, ByRef Xpos As Integer, ByRef Ypos As Integer, ByRef Width As Integer, ByRef Height As Integer) As Integer
Java:int Blk_GetBarcodeRect(HBLK BlkObj, int BarcodeInd, NSInt Xpos, NSInt Ypos, NSInt Width, NSInt Height)
Delphi:function Blk_GetBarcodeRect(BlkObj:HBLK; BarcodeInd:integer; out Xpos:integer; out Ypos:integer; out Width:integer; out Height:integer):integer


Description

Retrieves the bounding rectangle of the specified barcode.


Parameters

BlkObj [IN] – the Block object. You can also specify the Image object if you want to work with the global list of barcodes for the entire image.
BarcodeInd [IN] – the barcode index.
Xpos [OUT] – the address of the variable that will get the X coordinate of the top-left corner of the rectangle, in pixels.
Ypos [OUT] – the address of the variable that will get the Y coordinate of the top-left corner of the rectangle, in pixels.
Width [OUT] – the address of the variable that will get the width of the rectangle, in pixels.
Height [OUT] – the address of the variable that will get the height of the rectangle, in pixels.


Return value

Zero if success, otherwise an error code.


Remarks

The OCRSTEP_OCR step must be executed before calling this function.
For the best recognition quality, the rescaling and deskewing algorithms are applied to the original image at the OCRSTEP_PREFILTERS step. This function returns the position and size for the final image. To get the position/size for the original image, use the Img_CalcPointPosition function to convert coordinates.


Example

See the sample code for the Blk_GetBarcodeCnt function.