GpiQueryModelTransformMatrix: Difference between revisions
Appearance
No edit summary |
mNo edit summary |
||
| Line 1: | Line 1: | ||
This function returns the current model transform | This function returns the current model transform. | ||
==Syntax== | ==Syntax== | ||
GpiQueryModelTransformMatrix(hps, lCount, pmatlfArray) | GpiQueryModelTransformMatrix(hps, lCount, pmatlfArray) | ||
==Parameters== | ==Parameters== | ||
; hps ([[HPS]]) - input | ; hps ([[HPS]]) - input: Presentation-space handle. | ||
: Presentation-space handle. | ; lCount ([[LONG]]) - input: Number of elements. | ||
; lCount ([[LONG]]) - input | |||
: Number of elements. | |||
: The number of elements to be returned in pmatlfArray; must be in the range 0 through 9. If 0 is specified, no matrix elements are returned. | : The number of elements to be returned in pmatlfArray; must be in the range 0 through 9. If 0 is specified, no matrix elements are returned. | ||
; pmatlfArray (PMATRIXLF) - output: Transform matrix. | |||
; pmatlfArray (PMATRIXLF) - output | |||
: Transform matrix. | |||
: A structure in which the elements of the model transform matrix are returned. | : A structure in which the elements of the model transform matrix are returned. | ||
==Return Value== | ==Return Value== | ||
; rc ([[BOOL]]) - returns | ; rc ([[BOOL]]) - returns: Success indicator. | ||
: Success indicator. | ::TRUE : Successful completion | ||
: | ::FALSE : Error occurred. | ||
: | |||
==Remarks== | ==Remarks== | ||
| Line 28: | Line 21: | ||
==Errors== | ==Errors== | ||
Possible returns from WinGetLastError: | Possible returns from WinGetLastError: | ||
; PMERR_INV_HPS (0x207F) | ; PMERR_INV_HPS (0x207F): An invalid presentation-space handle was specified. | ||
: 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) | ; PMERR_INV_IN_RETAIN_MODE (0x208C): An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or draw-and-retain. | ||
: An attempt was made to access the presentation space from more than one thread simultaneously. | ; PMERR_INV_LENGTH_OR_COUNT (0x2092): An invalid length or count parameter was specified. | ||
; PMERR_INV_IN_RETAIN_MODE (0x208C) | ; 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. | ||
: An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or draw-and-retain. | |||
; PMERR_INV_LENGTH_OR_COUNT (0x2092) | |||
: An invalid length or count parameter was specified. | |||
; 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== | ||
This example uses GpiQueryModelTransformMatrix to query the first element of the current model transform after setting the draw mode to DRAW. | This example uses GpiQueryModelTransformMatrix to query the first element of the current model transform after setting the draw mode to DRAW. | ||
<pre> | <pre> | ||
#define INCL_GPITRANSFORMS /* Transform functions */ | #define INCL_GPITRANSFORMS /* Transform functions */ | ||
#define INCL_GPICONTROL /* Control functions */ | #define INCL_GPICONTROL /* Control functions */ | ||
#include | #include <os2.h> | ||
BOOL fSuccess; /* success indicator */ | BOOL fSuccess; /* success indicator */ | ||
Latest revision as of 22:00, 17 November 2025
This function returns the current model transform.
Syntax
GpiQueryModelTransformMatrix(hps, lCount, pmatlfArray)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- lCount (LONG) - input
- Number of elements.
- The number of elements to be returned in pmatlfArray; must be in the range 0 through 9. If 0 is specified, no matrix elements are returned.
- pmatlfArray (PMATRIXLF) - output
- Transform matrix.
- A structure in which the elements of the model transform matrix are returned.
Return Value
- rc (BOOL) - returns
- Success indicator.
- TRUE : Successful completion
- FALSE : Error occurred.
Remarks
This function is invalid when the drawing mode (see GpiSetDrawingMode) is set to retain.
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_IN_RETAIN_MODE (0x208C)
- An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or draw-and-retain.
- PMERR_INV_LENGTH_OR_COUNT (0x2092)
- An invalid length or count parameter was specified.
- 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
This example uses GpiQueryModelTransformMatrix to query the first element of the current model transform after setting the draw mode to DRAW.
#define INCL_GPITRANSFORMS /* Transform functions */ #define INCL_GPICONTROL /* Control functions */ #include <os2.h> BOOL fSuccess; /* success indicator */ HPS hps; /* Presentation-space handle */ LONG lCount; /* number of elements */ MATRIXLF pmatlfArray; /* transform matrix */ lCount = 1; /* examine only first element of transform matrix */ if (GpiSetDrawingMode(hps, DM_DRAW) == TRUE) fSuccess = GpiQueryModelTransformMatrix(hps, lCount, &pmatlfArray);