Nicomsoft OCR: Developer's Guide


Img_GetSize


Syntax

C++:int Img_GetSize(HIMG ImgObj, int* Width, int* Height)
C#:int Img_GetSize(int ImgObj, out int Width, out int Height)
Visual Basic:Function Img_GetSize(ByVal ImgObj As Integer, ByRef Width As Integer, ByRef Height As Integer) As Integer
Java:int Img_GetSize(HIMG ImgObj, NSInt Width, NSInt Height)
Delphi:function Img_GetSize(ImgObj:HIMG; out Width:integer; out Height:integer):integer


Description

Retrieves the current width and height of the image loaded to the Image object, in pixels.


Parameters

ImgObj [IN] – the Image object.
Width [OUT] – the variable that will get the image width.
Height [OUT] – the variable that will get the image height.


Return value

Zero if success, otherwise an error code.


Remarks

Before the OCRSTEP_PREFILTERS step, this function returns the original image size. The image can be rescaled at the OCRSTEP_PREFILTERS step for the best recognition quality. After that step, this function returns the new image size after rescaling.


Example

See the sample code for the Img_AddBlock function.