ImageGear Professional v18 for Mac
IG_dspl_image_draw

This function draws an image onto a destination device context.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_dspl_image_draw( 
        [IN] HIGEAR hIGear,
        [IN] DWORD dwGrpID,
        [IN] HWND hWnd,
        [IN] HDC hDC,
        [OUT] LPAT_RECTANGLE lpActualDeviceRect
);

Arguments:

Name Type Description
hIGear HIGEAR ImageGear handle from which to get options and pixel data.
dwGrpID DWORD Identifier of group from which to get display options.
hWnd HWND Pointer to NSView or NSScrollView object where image is to be displayed. Pointer must be casted to non-retainable HWND type with (__bridge HWND) operator.
hDC HDC Handle of the device context on which to draw the image. Can be NULL, and in this case no actual drawing is performed but all parameters are calculated and updated. This may be useful in calculating DisplayedImageRect in the next parameter of this function.
lpActualDeviceRect LPAT_RECTANGLE Pointer to the rectangle in which to copy DisplayedImageRect. This rectangle is calculated no matter whether hDC=NULL or not. If the value is NULL, then this parameter is ignored.

Return Value:

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

Supported Raster Image Formats:

All pixel formats supported by ImageGear Professional.

Example:

 
Copy Code
HIGEAR hIGear; /* HIGEAR handle of image
*/
DWORD nGrpID = 0; /* Display group identifier
*/
...
- (void)drawRect:(NSRect)dirtyRect
{
    if(IG_image_is_valid(hIGear))
    {
        CGContextRef myContext = [[NSGraphicsContext currentContext] graphicsPort];
        if([NSGraphicsContext currentContextDrawingToScreen])
            IG_dspl_image_draw(hIGear, 0, (__bridge HWND)self, (HDC)myContext, NULL);
        else
            IG_dspl_image_draw(hIGear, 0, NULL, (HDC)myContext, NULL);
    }
}

Remarks:

All options regarding how to draw the image are taken from the dwGrpID group. This function can also be used for the actual device rectangle calculation. If hDC=NULL then all parameters are calculated and updated but no actual drawing is performed.

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback