ImageGear for C and C++ on Windows v19.1 - Updated
IG_dspl_image_to_device
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Display Functions > IG_dspl_image_to_device

This function translates an array of pointers from image coordinates into device coordinates.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_dspl_image_to_device(
        [IN] HIGEAR hIGear,
        [IN] DWORD dwGrpID,
        [IN] HWND hWnd,
        [IN] HDC hDC,
        [IN/OUT] LPAT_POINT lpPoint,
        [IN] UINT nCount
);

Arguments:

Name Type Description
hIGear HIGEAR ImageGear handle of image.
dwGrpID DWORD Identifier of group from which to get display options.
hWnd HWND Handle of a window where the image is drawn.
hDC HDC Handle of the device context used for drawing. Can be NULL, but if it is necessary to perform a calculation for the printer device context, then a real value should be provided.
lpPoint LPAT_POINT Pointer to an array of points that should be translated.
nCount UINT Number of elements in lpPoint array.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

Image Processing

Example:

 
Copy Code
HIGEAR            hIGear;         /* HIGEAR handle of image                                       */ 
DWORD           nGrpID;         /* display group identifier                                     */
AT_POINT                 p[2];          /* array of point to translate                                  */
AT_RECTANGLE            ImageRect;              /* image rectangle                                      */
 ...
/* calculates device coordinates of current image rectangle */   
IG_dspl_layout_get( hIGear, nGrpID, &ImageRect, NULL, NULL, NULL, NULL, NULL, NULL );
p[0].x = ImageRect.x;
p[0].y = ImageRect.y;
p[1].x = ImageRect.x + ImageRect.width - 1;
p[1].y = ImageRect.y + ImageRect.height - 1;
IG_dspl_image_to_device( hIGear, nGrpID, hWnd, NULL, p, 2 );
 ...

Remarks:

This function takes into account all display parameters including orientation and current scrolling position.