Jump to content

GpiQueryBitmapDimension: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function returns the width and height of a bit map, as specified on a previous GpiSetBitmapDimension function.
This function returns the width and height of a bit map, as specified on a previous [[GpiSetBitmapDimension]] function.


==Syntax==
==Syntax==
<PRE>
rc = GpiQueryBitmapDimension(hbm, psizlBitmapDimension);
rc = GpiQueryBitmapDimension(hbm, psizlBitmapDimension);
 
</PRE>
==Parameters==
==Parameters==
; hbm (HBITMAP) - input : Bit-map handle.
;hbm (HBITMAP) - input: Bit-map handle.
 
;psizlBitmapDimension (PSIZEL) - output : Size of bit map.
; psizlBitmapDimension (PSIZEL) - output : Size of bit map.
:The width and height of the bit map in 0.1 millimeter units.
: The width and height of the bit map in 0.1 millimeter units.
:If not set by GpiSetBitmapDimension, zeros are returned.
: If not set by GpiSetBitmapDimension, zeros are returned.


==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==  
Line 21: Line 19:
; 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==


==Example Code==
==Example Code==
This example uses GpiQueryBitmapDimension to return the width and height of a bit map, as specified on a previous
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.
GpiSetBitmapDimension call; if successful, it assigns the width to a variable.
<PRE>
<PRE>
#define INCL_GPIBITMAPS /* Bit-map functions */
#define INCL_GPIBITMAPS /* Bit-map functions */
Line 42: Line 36:
if (fSuccess == TRUE)
if (fSuccess == TRUE)
     lWidth = psizlBitmapDimension.cx;
     lWidth = psizlBitmapDimension.cx;
</PRE>
</PRE>
==Related Functions==
* [[GpiSetBitmapDimension]]


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

Latest revision as of 00:44, 20 July 2020

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.

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;