GpiQueryDefaultViewMatrix: Difference between revisions
Appearance
Created page with "==Syntax== GpiQueryDefaultViewMatrix(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. : An array into which the elements of the default viewing transform matrix are returned. ==Return Va..." |
No edit summary |
||
Line 1: | Line 1: | ||
This function returns the current default viewing transform; see [[GpiSetDefaultViewMatrix]]. | |||
==Syntax== | ==Syntax== | ||
GpiQueryDefaultViewMatrix(hps, lCount, pmatlfArray); | GpiQueryDefaultViewMatrix(hps, lCount, pmatlfArray); | ||
==Parameters== | ==Parameters== |
Latest revision as of 14:16, 7 April 2025
This function returns the current default viewing transform; see GpiSetDefaultViewMatrix.
Syntax
GpiQueryDefaultViewMatrix(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.
- An array into which the elements of the default viewing transform matrix are returned.
Return Value
- 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_LENGTH_OR_COUNT (0x2092)
- An invalid length or count parameter was specified.
Example Code
#define INCL_GPITRANSFORMS /* Or use INCL_GPI, INCL_PM, */ #include <os2.h> HPS hps; /* Presentation-space handle. */ LONG lCount; /* Number of elements. */ PMATRIXLF pmatlfArray; /* Transform matrix. */ BOOL rc; /* Success indicator. */ rc = GpiQueryDefaultViewMatrix(hps, lCount, pmatlfArray);
This example uses GpiQueryDefaultViewMatrix to return the default viewing transform and, if successful, defines - via GpiSetDefaultViewMatrix - the returned value as the new default transform.
#define INCL_GPITRANSFORMS /* Transform functions */ #include <os2.h> BOOL fSuccess; /* success indicator */ HPS hps; /* Presentation-space handle */ LONG lCount; /* number of elements */ MATRIXLF pmatlfArray; /* transform matrix */ LONG lOptions; /* set default options */ lCount = 1; /* examine only first element of transform matrix */ fSuccess = GpiQueryDefaultViewMatrix(hps, lCount, &pmatlfArray); /* set default to returned transform */ if (fSuccess == TRUE) { lOptions = TRANSFORM_REPLACE; fSuccess = GpiSetDefaultViewMatrix(hps, lCount, &pmatlfArray, lOptions); }