GpiQueryPickAperturePosition: Difference between revisions
Appearance
Created page with "==Description== This function returns the position of the center of the pick aperture. ==Syntax== <pre> #define INCL_GPICORRELATION →Or use INCL_GPI, INCL_PM,: #include <..." |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
This function returns the position of the centre of the pick aperture. | |||
This function returns the position of the | |||
==Syntax== | ==Syntax== | ||
GpiQueryPickAperturePosition(hps, pptlPoint); | |||
==Parameters== | ==Parameters== | ||
; hps (HPS) - input : Presentation-space handle. | ;hps (HPS) - input : Presentation-space handle. | ||
;pptlPoint (PPOINTL) - output : Pick-aperture position. | |||
; pptlPoint (PPOINTL) - output : Pick-aperture position. | :Position of the centre of the pick aperture, in presentation-page coordinates. | ||
Position of the | |||
==Return Code== | ==Return Code== | ||
; rc (BOOL) - returns : Success indicator. | ;rc (BOOL) - returns : Success indicator. | ||
*TRUE : Successful completion | |||
*FALSE : Error occurred. | |||
===Errors=== | ===Errors=== | ||
Possible returns from WinGetLastError | Possible returns from WinGetLastError: | ||
; PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified. | ; PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified. | ||
; PMERR_PS_BUSY (0x20F4) : An attempt was made to access the presentation space from more than one thread simultaneously. | ; PMERR_PS_BUSY (0x20F4) : An attempt was made to access the presentation space from more than one thread simultaneously. | ||
; PMERR_INV_DC_TYPE (0x2060) : An invalid type parameter was specified with DevOpenDC, or a function was issued that is invalid for a OD_METAFILE_NOQUERY device context. | ; PMERR_INV_DC_TYPE (0x2060) : An invalid type parameter was specified with DevOpenDC, or a function was issued that is invalid for a OD_METAFILE_NOQUERY device context. | ||
==Example Code== | ==Example Code== | ||
In this example we query the position of the centre of the pick aperture. | |||
<pre> | <pre> | ||
#define INCL_GPICORELATION | |||
#include <OS2.H> | |||
BOOL flResult; | |||
HPS hps; /* Presentation space handle. */ | |||
POINTL ptlRefPoint; /* Pick-aperture position. */ | |||
LONG xcoord, ycoord; | |||
flResult = GpiPickAperturePosition(hps, &ptlRefPoint); | |||
xcoord = ptlRefPoint.x; ycoord = ptlRefPoint.y; | |||
</pre> | </pre> | ||
==Related Functions== | ==Related Functions== | ||
* [[GpiQueryPickApertureSize]] | * [[GpiQueryPickApertureSize]] | ||
* [[GpiSetPickAperturePosition]] | * [[GpiSetPickAperturePosition]] | ||
[[Category: | [[Category:Gpi]] |
Latest revision as of 01:11, 13 June 2019
This function returns the position of the centre of the pick aperture.
Syntax
GpiQueryPickAperturePosition(hps, pptlPoint);
Parameters
- hps (HPS) - input
- Presentation-space handle.
- pptlPoint (PPOINTL) - output
- Pick-aperture position.
- Position of the centre of the pick aperture, in presentation-page coordinates.
Return Code
- rc (BOOL) - returns
- Success indicator.
- TRUE : Successful completion
- FALSE : Error occurred.
Errors
Possible returns from WinGetLastError:
- PMERR_INV_HPS (0x207F)
- An invalid presentation-space handle was specified.
- PMERR_PS_BUSY (0x20F4)
- An attempt was made to access the presentation space from more than one thread simultaneously.
- PMERR_INV_DC_TYPE (0x2060)
- An invalid type parameter was specified with DevOpenDC, or a function was issued that is invalid for a OD_METAFILE_NOQUERY device context.
Example Code
In this example we query the position of the centre of the pick aperture.
#define INCL_GPICORELATION #include <OS2.H> BOOL flResult; HPS hps; /* Presentation space handle. */ POINTL ptlRefPoint; /* Pick-aperture position. */ LONG xcoord, ycoord; flResult = GpiPickAperturePosition(hps, &ptlRefPoint); xcoord = ptlRefPoint.x; ycoord = ptlRefPoint.y;