This section provides information about how to delete DIBs and DDBs.
- To delete the HIGEAR, but keep the DIB in existence (and obtain its address):
Copy Code IG_image_DIB_export( hIGear, lpDIB, DIBSize, &Options);
The DIB's address is returned in your LPAT_DIB variable lpDIB.
- To delete the HIGEAR and the DIB, but produce a copy of the image in DDB format, use IG_dspl_DDB_create:
Copy Code IG_dspl_DDB_create( hIGear, IG_GRP_DEFAULT, hDC, nWidth, nHeight, TRUE, &hBitmap, &hPalette )
Provide the HIGEAR handle of the image to delete, and provide the addresses of the HBITMAP and HPALETTE variables to receive the handles for the created DDB and palette.
- To delete a HIGEAR, including the DIB, when you are entirely done using it, use the following call to IG_image_delete:
Copy Code IG_image_delete ( hIGear );
Note that in all the above cases, ImageGear will not release memory that it did not allocate. For example, assume your application has allocated memory, created a DIB, and subsequently used an IG_image_DIB_import() call to give this DIB a HIGEAR handle. In this case, a later call to IG_image_delete() will delete the HIGEAR structure but will not free the DIB's memory. The owner of the DIB's memory (in this case, your application) would issue a Windows DeleteObject() call to free this memory.