Jump to content

GpiQueryBitmapDimension: Difference between revisions

From EDM2
Created page with "This function returns the width and height of a bit map, as specified on a previous GpiSetBitmapDimension function. ==Syntax== <PRE> rc = GpiQueryBitmapDimension(hbm, psizlBi..."
 
Line 46: Line 46:


==Related Functions==
==Related Functions==
* GpiSetBitmapDimension
* [[GpiSetBitmapDimension]]


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

Revision as of 02:28, 31 December 2019

This function returns the width and height of a bit map, as specified on a previous GpiSetBitmapDimension function.

Syntax

rc = GpiQueryBitmapDimension(hbm, psizlBitmapDimension);

Parameters

hbm (HBITMAP) - input
Bit-map handle.
psizlBitmapDimension (PSIZEL) - output
Size of bit map.
The width and height of the bit map in 0.1 millimeter units.
If not set by GpiSetBitmapDimension, zeros are returned.

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

Example Code

This example uses GpiQueryBitmapDimension to return the width and height of a bit map, as specified on a previous GpiSetBitmapDimension call; if successful, it assigns the width to a variable.

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

BOOL fSuccess; /* success indicator */
HBITMAP hbm; /* bit-map handle */
SIZEL psizlBitmapDimension; /* size of bit map */
LONG lWidth; /* width of bit map */

fSuccess = GpiQueryBitmapDimension(hbm, &psizlBitmapDimension);

/* if successful, assign value of bit-map width */
if (fSuccess == TRUE)
    lWidth = psizlBitmapDimension.cx;

Related Functions