gpi12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GpiSetBitmap (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPIBITMAPS
 
HBITMAP GpiSetBitmap(hps, hbm)
HPS hps;        /* presentation-space handle */
HBITMAP hbm;    /* bitmap handle             */
 
The GpiSetBitmap function sets a bitmap as the current bitmap in a memory
device context. The function sets the bitmap specified by hbm. This bitmap
must not be set for any other device context and must not be set for area
shading. If another bitmap is already set in the device context, the
function releases the old bitmap and returns its handle.
 
The specified presentation space must be currently associated with a memory
device context. If the bitmap format is not the same as the device context,
the bitmap format must be convertible to one supported by the device. This
is guaranteed if the bitmap has one of the standard formats.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the presentation space.
 
hbm        Identifies the bitmap to set. If it is NULL, the function
           releases the bitmap currently set in the associated device.
 
Return Value
 
The return value is the old bitmap handle, NULL for a null handle, or
BMB_ERROR if an error occurred.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_BITMAP_IN_USE
     PMERR_INCOMPATIBLE_BITMAP
     PMERR_INV_HBITMAP
 
See Also
 
DevOpenDC, GpiCreateBitmap, GpiLoadBitmap, GpiSetBitmapId, WinGetLastError