GpiQueryBitmapParameters: Difference between revisions
Appearance
mNo edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
;hbm (HBITMAP) - input: Bit-map handle. | ;hbm ([[HBITMAP]]) - input: Bit-map handle. | ||
;pbmpData (P[[BITMAPINFOHEADER]]) - in/out: Bit-map information header. | ;pbmpData (P[[BITMAPINFOHEADER]]) - in/out: Bit-map information header. | ||
:This is a structure, that on return, is filled with data for the specified bit map. The structure includes the elements (width, height, planes, bitcount) of a bit-map information table. | :This is a structure, that on return, is filled with data for the specified bit map. The structure includes the elements (width, height, planes, bitcount) of a bit-map information table. | ||
Line 11: | Line 11: | ||
==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== |
Latest revision as of 23:16, 7 April 2025
This function returns information about a bit map identified by the bit-map handle.
Syntax
GpiQueryBitmapParameters(hbm, pbmpData)
Parameters
- hbm (HBITMAP) - input
- Bit-map handle.
- pbmpData (PBITMAPINFOHEADER) - in/out
- Bit-map information header.
- This is a structure, that on return, is filled with data for the specified bit map. The structure includes the elements (width, height, planes, bitcount) of a bit-map information table.
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_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 cbFix field of the BITMAPINFOHEADER structure must be set by the application before performing this function.
Example Code
This example uses GpiQueryBitmapParameters to return information about a bit map identified by the bit-map handle; if successful, it assigns the width field to a variable.
#define INCL_GPIBITMAPS /* Bit-map functions */ #include <os2.h> BOOL fSuccess; /* success indicator */ HBITMAP hbm; /* bit-map handle */ BITMAPINFOHEADER pbmpData; /* bit-map information header */ USHORT usWidth; /* width of bit map */ /* set size of info structure */ pbmpData.cbFix = sizeof(BITMAPINFOHEADER); fSuccess = GpiQueryBitmapParameters(hbm, &pbmpData); /* if successful, assign value of bit-map width */ if (fSuccess == TRUE) usWidth = pbmpData.cx;