GpiDeleteBitmap

This function deletes a bit map.

Syntax

 * 1) define INCL_GPIBITMAPS /* Or use INCL_GPI, INCL_PM, Also in COMMON section */
 * 2) include 

HBITMAP hbm; /* Handle of the bit map to be deleted. */ BOOL rc; /* Success indicator. */

rc = GpiDeleteBitmap(hbm); 

Parameters

 * hbm (HBITMAP) - input : Handle of the bit map to be deleted.

Return Code

 * rc (BOOL) - returns : Success indicator.
 * TRUE: Successful completion
 * FALSE: Error occurred.

Errors
Possible returns from WinGetLastError :
 * PMERR_INV_HBITMAP (0x207B) : An invalid bit-map handle was specified.
 * PMERR_BITMAP_IS_SELECTED (0x2009) : An attempt was made to delete a bit map while it was selected into a device context.
 * PMERR_HBITMAP_BUSY (0x2032) : An internal bit map busy error was detected. The bit map was locked by one thread during an attempt to access it from another thread.

Remarks
There are restrictions on the use of this function while generating a metafile or a PM_Q_STD print file; see "MetaFile Resolutions" in the Presentation Manager Programming Reference for more information.

Example Code
This example uses the GpiDeleteBitmap function to delete a bit map. The GpiSetBitmap function releases the bit map from the presentation space before deleting it. This is needed only if the bit map is set in the presentation space. 
 * 1) define INCL_GPIBITMAPS /* GPI Bit map functions */
 * 2) include 

HPS hps; /* presentation space handle */ HBITMAP hbm, hbmPrevious;

hbm = GpiLoadBitmap(hps, 0L, 1, 0L, 0L); /* load the bit map */ hbmPrevious = GpiSetBitmap(hps, hbm);    /* set bit map for PS */

/* bit map displayed with GpiBitBlt */

GpiSetBitmap(hps, hbmPrevious);     /* release bit map from PS */ GpiDeleteBitmap(hbm);               /* delete the bit map */ 

Related Functions

 * GpiBitBlt
 * GpiCreateBitmap
 * GpiDrawBits
 * GpiLoadBitmap
 * GpiQueryBitmapBits
 * GpiQueryBitmapDimension
 * GpiQueryBitmapHandle
 * GpiQueryBitmapParameters
 * GpiQueryDeviceBitmapFormats
 * GpiSetBitmap
 * GpiSetBitmapBits
 * GpiSetBitmapDimension
 * GpiSetBitmapId
 * GpiWCBitBlt