ImageGear Professional v18.1 > 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.
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 ); |
Name | Type | Description |
hIGear | HIGEAR | ImageGear handle of image. |
dwGrpID | DWORD | Identifier of group from which to get display options. |
hWnd | HWND | Pointer to NSView or NSScrollView object where image is drawn. Pointer must be casted to non-retainable HWND type with (__bridge HWND) operator. |
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. |
Returns the number of ImageGear errors that occurred during this function call.
All pixel formats supported by ImageGear Professional.
Copy Code
|
|
---|---|
NSView* nsView = self; HIGEAR hIGear; /* HIGEAR handle of image */ DWORD nGrpID = 0; /* 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, (__bridge HWND)nsView, NULL, p, 2 ); ... |
This function takes into account all display parameters including orientation and current scrolling position.