ImageGear Professional v18 for Mac
IG_dspl_DDB_create

This function creates a DDB of the image.

Declaration:

 
Copy Code
AT_ERRCOUNT   ACCUAPI  IG_dspl_DDB_create(
        [IN] HIGEAR hIGear,
        [IN] DWORD dwGrpID,
        [IN] HDC hDC,
        [IN] AT_DIMENSION nWidth,
        [IN] AT_DIMENSION nHeight,
        [IN] BOOL bExport,
        [OUT] HBITMAP FAR* lphBitmap,
        [OUT] HPALETTE FAR* lphPalette
);

Arguments:

Name Type Description
hIGear HIGEAR ImageGear handle of image.
dwGrpID DWORD Identifier of group in which the options are stored.
hDC HDC Handle of device context with which the DDB should be compatible. If NULL, then the DDB will be compatible with the desktop's device context.
nWidth AT_DIMENSION Width of DDB that is to be created.
nHeight AT_DIMENSION Height of DDB that is to be created.
bExport BOOL Boolean parameter which specifies whether to delete the source image or not. If TRUE then the hIGear image will be deleted after the DDB is created, but if FALSE then the image is left unchanged.
lphBitmap HBITMAP FAR* Pointer to where to return the DDB. For Mac OS X, DDB is CGImageRef object.
lphPalette HPALETTE FAR* Pointer to where to return the palette handle for this DDB. For Mac OS X, this parameter should be NULL.

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; /* display group identifier */
HBITMAP hBitmap; /* handle of bitmap */
- (IBAction)mnuFileConvertToDDB:(id)sender {
    if(IG_image_is_valid(hIGear))
    {
        if(hBitmap != 0)
        {
            CGImageRelease(hBitmap);
            hBitmap = 0;
        }
        AT_DIMENSION width, height;
        IG_image_dimensions_get( hIGear, &width, &height, NULL );
        IG_dspl_DDB_create( hIGear, 0, NULL, width, height, TRUE, &hBitmap, NULL);
        hIGear = 0;
        // Update main view
        [mainScrollViewOutlet setNeedsDisplay:YES];
    }
}

Remarks:

This function always uses all the display options specified by dwGrpIDgroup and assumes that the output device has a 32bpp RGB color format, but the client area of the output device is a rectangle of nWidth x nHeight size.

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback