ImageGear Professional v18.1 > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Display Functions > IG_dspl_device_to_image |
This function translates an array of points from device coordinates to image coordinates.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_dspl_device_to_image( [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 the group from which to get the 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. This can be NULL, but if a calculation is necessary for a printer device context, then you should provide the real value. |
lpPoint | LPAT_POINT | Pointer to an array of points that should be translated. |
nCount | UINT | Number of elements in the 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 */ NSRect rc = [nsView frame]; /* calculate coordinates in image coordinate space of current client rectangle of the window */ p[0].x = rc.origin.x;; p[0].y = rc.origin.y; p[1].x = rc.origin.x + rc.size.width - 1; p[1].y = rc.origin.y + rc.size.height - 1; IG_dspl_device_to_image( hIGear, nGrpID, (__bridge HWND)nsView, NULL, p, 2 ); |
This function takes into account all display parameters including orientation and current scrolling position.