GpiQueryDefaultViewMatrix
Appearance
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
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);
}