GreConvert: Difference between revisions
Appearance
mNo edit summary |
|||
Line 1: | Line 1: | ||
GreConvert converts the specified coordinates from one coordinate space to another by using the current values of the transforms. | GreConvert converts the specified coordinates from one coordinate space to another by using the current values of the transforms. | ||
This function can be hooked by the presentation driver. | This function can be hooked by the presentation driver. | ||
; Simulation support: This function is simulated by a handling routine in the graphics engine. | ;Simulation support: This function is simulated by a handling routine in the graphics engine. | ||
== Syntax == | == Syntax == | ||
GreConvert(hdc, lSrc, lDst, paptlPoint, cPoints, pInstance, lFunction) | GreConvert(hdc, lSrc, lDst, paptlPoint, cPoints, pInstance, lFunction) | ||
== Parameters == | == Parameters == | ||
; hdc (HDC) - input : Device context handle. | ;hdc (HDC) - input : Device context handle. | ||
;lSrc (LONG) - input : Source-coordinate space. | |||
; lSrc (LONG) - input : Source-coordinate space. | :;CVTC_WORLD :World-coordinate space | ||
:;CVTC_WORLD :World-coordinate space | :;CVTC_MODEL :Model space | ||
:;CVTC_MODEL :Model space | :;CVTC_DEFAULTPAGE :Default page-coordinate space | ||
:;CVTC_DEFAULTPAGE :Default page-coordinate space | :;CVTC_PAGE :Page-coordinate space | ||
:;CVTC_PAGE :Page-coordinate space | :;CVTC_DEVICE :Device-coordinate space. Screen coordinates are 32-bit signed integers and are used by the presentation driver as screen pel addresses. | ||
:;CVTC_DEVICE :Device-coordinate space. Screen coordinates are 32-bit signed integers and are used by the presentation driver as screen pel addresses. | ;lDst (LONG) - input : Target-coordinate space. Defined by the same values as lSrc. | ||
;paptlPoint (PPOINTL) - input : Pointer to array of (x, y) coordinates to transform. The result is also returned to this parameter. | |||
; lDst (LONG) - input : Target-coordinate space. Defined by the same values as lSrc. | ;cPoints (LONG) - input : Count of coordinate pairs in the array. | ||
;pInstance (PVOID) - input : Pointer to instance data. | |||
; paptlPoint (PPOINTL) - input : Pointer to array of (x, y) coordinates to transform. The result is also returned to this parameter. | ;lFunction (ULONG) - input : High-order WORD=flags; low-order WORD=NGreConvert. | ||
; cPoints (LONG) - input : Count of coordinate pairs in the array. | |||
; pInstance (PVOID) - input : Pointer to instance data. | |||
; lFunction (ULONG) - input : High-order WORD=flags; low-order WORD=NGreConvert. | |||
== Returns == | == Returns == | ||
; fSuccess (BOOL) - returns : This function returns BOOLEAN (fSuccess). | ;fSuccess (BOOL) - returns : This function returns BOOLEAN (fSuccess). | ||
:;TRUE : Successful | :;TRUE : Successful | ||
:;FALSE : Error | :;FALSE : Error | ||
Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include: | |||
Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include: | * PMERR_COORDINATE_OVERFLOW | ||
* PMERR_COORDINATE_OVERFLOW | * PMERR_HDC_BUSY | ||
* PMERR_HDC_BUSY | * PMERR_INV_COORD_SPACE | ||
* PMERR_INV_COORD_SPACE | * PMERR_INV_HDC | ||
* PMERR_INV_HDC | * PMERR_INV_LENGTH_OR_COUNT | ||
* PMERR_INV_LENGTH_OR_COUNT | Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation. | ||
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation. | |||
== Sample == | == Sample == | ||
Line 56: | Line 48: | ||
BOOL fSuccess; /* This function returns BOOLEAN (fSuccess). */ | BOOL fSuccess; /* This function returns BOOLEAN (fSuccess). */ | ||
fSuccess = GreConvert(hdc, lSrc, lDst, paptlPoint, | fSuccess = GreConvert(hdc, lSrc, lDst, paptlPoint, cPoints, pInstance, lFunction); | ||
</pre> | </pre> | ||
[[Category:Gre]] | [[Category:Gre]] |
Latest revision as of 02:16, 24 March 2020
GreConvert converts the specified coordinates from one coordinate space to another by using the current values of the transforms.
This function can be hooked by the presentation driver.
- Simulation support
- This function is simulated by a handling routine in the graphics engine.
Syntax
GreConvert(hdc, lSrc, lDst, paptlPoint, cPoints, pInstance, lFunction)
Parameters
- hdc (HDC) - input
- Device context handle.
- lSrc (LONG) - input
- Source-coordinate space.
- CVTC_WORLD
- World-coordinate space
- CVTC_MODEL
- Model space
- CVTC_DEFAULTPAGE
- Default page-coordinate space
- CVTC_PAGE
- Page-coordinate space
- CVTC_DEVICE
- Device-coordinate space. Screen coordinates are 32-bit signed integers and are used by the presentation driver as screen pel addresses.
- lDst (LONG) - input
- Target-coordinate space. Defined by the same values as lSrc.
- paptlPoint (PPOINTL) - input
- Pointer to array of (x, y) coordinates to transform. The result is also returned to this parameter.
- cPoints (LONG) - input
- Count of coordinate pairs in the array.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreConvert.
Returns
- fSuccess (BOOL) - returns
- This function returns BOOLEAN (fSuccess).
- TRUE
- Successful
- FALSE
- Error
Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
- PMERR_COORDINATE_OVERFLOW
- PMERR_HDC_BUSY
- PMERR_INV_COORD_SPACE
- PMERR_INV_HDC
- PMERR_INV_LENGTH_OR_COUNT
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
Sample
#define INCL_GRE_XFORMS #include <os2.h> HDC hdc; /* Device context handle. */ LONG lSrc; /* Source-coordinate space. */ LONG lDst; /* Target-coordinate space. Defined by the same values as lSrc. */ PPOINTL paptlPoint; LONG cPoints; /* Count of coordinate pairs in the array. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreConvert. */ BOOL fSuccess; /* This function returns BOOLEAN (fSuccess). */ fSuccess = GreConvert(hdc, lSrc, lDst, paptlPoint, cPoints, pInstance, lFunction);