Jump to content

GpiQueryBitmapParameters: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
This function returns information about a bit map identified by the bit-map handle.
This function returns information about a bit map identified by the bit-map handle.
==Syntax==
==Syntax==
<PRE>
GpiQueryBitmapParameters(hbm, pbmpData)
rc = GpiQueryBitmapParameters(hbm, pbmpData);
 
</PRE>
==Parameters==  
==Parameters==  
; hbm (HBITMAP) - input : Bit-map handle.
;hbm (HBITMAP) - input: Bit-map handle.
 
;pbmpData (P[[BITMAPINFOHEADER]]) - in/out: Bit-map information header.
; 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.
: 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==
==Return Code==
; rc (BOOL) - returns : Success indicator.
;rc (BOOL) - returns : Success indicator.
: TRUE : Successful completion
:TRUE : Successful completion
: FALSE : Error occurred.
:FALSE : Error occurred.


==Errors==  
==Errors==  
Possible returns from WinGetLastError
Possible returns from WinGetLastError
; PMERR_INV_HBITMAP (0x207B) : An invalid bit-map handle was specified.
;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.
;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==
==Remarks==

Revision as of 03:05, 1 January 2020

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;

Related Functions