Nicomsoft OCR: Developer's Guide


Blk_GetRect


Syntax

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


Description

Retrieves the size and position of the specified Block object.


Parameters

BlkObj [IN] – the Block object.
Xpos [OUT] – the address of the variable that will get the X coordinate of the top-left corner of the block, in pixels.
Ypos [OUT] – the address of the variable that will get the Y coordinate of the top-left corner of the block, in pixels.
Width [OUT] – the address of the variable that will get the width of the block, in pixels.
Height [OUT] – the address of the variable that will get the height of the block, in pixels.


Return value

Zero if success, otherwise an error code.


Remarks

If the block was created before the OCRSTEP_PREFILTERS step (though it is not recommended), its coordinates will be recalculated at this step if the rescaling and deskewing algorithms are applied to the original image.


Example

See the sample code for the Img_GetBlockCnt function.