Jump to content

GpiQueryBitmapInfoHeader

From EDM2
Revision as of 00:11, 5 May 2017 by Martini (talk | contribs) (Created page with "This function returns information about a bit map identified by the bit-map handle. ==Syntax== <PRE> rc = GpiQueryBitmapInfoHeader(hbm, pbmpData) </PRE> ==Parameters== ; hbm ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function returns information about a bit map identified by the bit-map handle.

Syntax

rc = GpiQueryBitmapInfoHeader(hbm, pbmpData)

Parameters

hbm (HBITMAP) - input
Bit-map handle.
pbmpData (PBITMAPINFOHEADER2) - in/out
Bit-map information header.

_ This is a structure, that on return, is filled with data for the specified bit map.

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

Return Code

Errors

Possible returns from WinGetLastError

PMERR_INV_HBITMAP (0x207B)
An invalid bit-map handle was specified.
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

The length field of the BITMAPINFOHEADER2 structure must be set by the application before performing this function.

Note: This function should be used in preference to the GpiQueryBitmapParameters function.

Example Code

This example uses GpiQueryBitmapInfoHeader to return information about a bit map identified by the bit-map handle; if successful, it uses this information to create a new bit map via GpiCreateBitmap.

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

HPS hps; /* presentation-space handle */
BOOL fSuccess; /* success indicator */
HBITMAP hbm; /* bit-map handle */
HBITMAP hbmNew; /* bit-map handle */
BITMAPINFOHEADER2 pbmp2Data; /* Bit-map information header */
PBYTE pb; /* address of bit-map image data in resource */

/* set size of info structure */
pbmp2Data.cbFix = 16L;

fSuccess = GpiQueryBitmapInfoHeader(hbm, &pbmp2Data);

/* use information to create bit map */
hbmNew = GpiCreateBitmap(hps, /* presentation space */
            &pbmp2Data, /* bit-map information header */
            CBM_INIT, /* initialize the bit map */
            pb, /* bit-map data */
            (PBITMAPINFO2)&pbmp2Data);
/* bit-map information table */

Related Functions