Nicomsoft OCR: Developer's Guide


Img_DrawToDC


Syntax

C++:int Img_DrawToDC(HIMG ImgObj, int HandleDC, int X, int Y, int* Width, int* Height, int Flags)
C#:int Img_DrawToDC(int ImgObj, int HandleDC, int X, int Y, ref int Width, ref int Height, int Flags)
Visual Basic:Function Img_DrawToDC(ByVal ImgObj As Integer, ByVal HandleDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByRef Width As Integer, ByRef Height As Integer, ByVal Flags As Integer) As Integer
Java:NONE
Delphi:function Img_DrawToDC(ImgObj:HIMG; HandleDC:integer; X:integer; Y:integer; var Width:integer; var Height:integer; Flags:integer):integer


Description

Draws the current image loaded to the Image object to the specified Windows Display Device Context (DC). If necessary, scales the image, preserving its proportions.


Parameters

ImgObj [IN] – the Image object.
HandleDC [IN] – the destination device context handle (HDC). Specify 0 to avoid drawing.
X [IN] – the X coordinate of the destination top-left corner, in pixels.
X [IN] – the Y coordinate of the destination top-left corner, in pixels.
Width [IN,OUT] – IN: the maximum allowed width of the drawing rectangle, in pixels; specify 0 to use the image width. OUT: the actual width of the drawing rectangle.
Height [IN,OUT] – IN: the maximum allowed height of the drawing rectangle, in pixels; specify 0 to use the image height. OUT: the actual height of the drawing rectangle.
Flags [IN] – the drawing flags. See the DRAW_XXXXX constants for possible values.


Return value

Zero if success, otherwise an error code.


Remarks

Java: This function is not available.
Linux platform: This function is not available.


Example

See the sample projects in the NSOCR SDK.