Jump to content

GpiDeleteBitmap: Difference between revisions

From EDM2
Created page with "This function deletes a bit map. ==Syntax== <PRE> #define INCL_GPIBITMAPS Or use INCL_GPI, INCL_PM, Also in COMMON section: #include <os2.h> HBITMAP hbm; /* Handle of t..."
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:


==Syntax==
==Syntax==
<PRE>
GpiDeleteBitmap(hbm)
#define INCL_GPIBITMAPS /* Or use INCL_GPI, INCL_PM, Also in COMMON section */
#include <os2.h>
 
HBITMAP hbm; /* Handle of the bit map to be deleted. */
BOOL rc; /* Success indicator. */
 
rc = GpiDeleteBitmap(hbm);
</PRE>
==Parameters==
==Parameters==
; hbm (HBITMAP) - input : Handle of the bit map to be deleted.
; hbm ([[HBITMAP]]) - input : Handle of the bit map to be deleted.
==Return Code==
==Return Code==
; rc (BOOL) - returns : Success indicator.
; rc ([[BOOL]]) - returns : Success indicator.
* TRUE: Successful completion
:; TRUE
* FALSE: Error occurred.
:: Successful completion
:; FALSE
:: Error occurred.


==Errors==  
==Errors==  
Line 28: Line 22:


==Example Code==
==Example Code==
<PRE>
#define INCL_GPIBITMAPS /* Or use INCL_GPI, INCL_PM, Also in COMMON section */
#include <os2.h>
HBITMAP hbm; /* Handle of the bit map to be deleted. */
BOOL rc; /* Success indicator. */
rc = GpiDeleteBitmap(hbm);
</PRE>
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.
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.
<PRE>
<PRE>
Line 46: Line 49:


==Related Functions==
==Related Functions==
* GpiBitBlt
* [[GpiBitBlt]]
* GpiCreateBitmap
* [[GpiCreateBitmap]]
* GpiDrawBits
* [[GpiDrawBits]]
* GpiLoadBitmap
* [[GpiLoadBitmap]]
* GpiQueryBitmapBits
* [[GpiQueryBitmapBits]]
* GpiQueryBitmapDimension
* [[GpiQueryBitmapDimension]]
* GpiQueryBitmapHandle
* [[GpiQueryBitmapHandle]]
* GpiQueryBitmapParameters
* [[GpiQueryBitmapParameters]]
* GpiQueryDeviceBitmapFormats
* [[GpiQueryDeviceBitmapFormats]]
* GpiSetBitmap
* [[GpiSetBitmap]]
* GpiSetBitmapBits
* [[GpiSetBitmapBits]]
* GpiSetBitmapDimension
* [[GpiSetBitmapDimension]]
* GpiSetBitmapId
* [[GpiSetBitmapId]]
* GpiWCBitBlt
* [[GpiWCBitBlt]]


[[Category:Gpi]]
[[Category:Gpi]]

Latest revision as of 23:26, 7 April 2025

This function deletes a bit map.

Syntax

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

#define INCL_GPIBITMAPS /* Or use INCL_GPI, INCL_PM, Also in COMMON section */
#include <os2.h>

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

rc = GpiDeleteBitmap(hbm);

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.

#define INCL_GPIBITMAPS /* GPI Bit map functions */
#include <os2.h>

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