Jump to content

GpiQueryDefaultViewMatrix: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function returns the current default viewing transform; see [[GpiSetDefaultViewMatrix]].  
This function returns the current default viewing transform; see [[GpiSetDefaultViewMatrix]].
 
==Syntax==
==Syntax==
  GpiQueryDefaultViewMatrix(hps, lCount, pmatlfArray);
  GpiQueryDefaultViewMatrix(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.
: An array into which the elements of the default viewing transform matrix are returned.
: An array into which the elements of the default viewing transform matrix are returned.


==Return Value==
==Return Value==
; rc (BOOL) - returns
; rc (BOOL) - returns: Success indicator.
: Success indicator.
::TRUE : Successful completion
:; TRUE
::FALSE : Error occurred.
:: Successful completion
:; FALSE
:: Error occurred.


==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_LENGTH_OR_COUNT (0x2092): An invalid length or count parameter was specified.
: 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==
==Example Code==
<PRE>
#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);
</PRE>
This example uses GpiQueryDefaultViewMatrix to return the default viewing transform and, if successful, defines - via GpiSetDefaultViewMatrix - the returned value as the new default transform.
This example uses GpiQueryDefaultViewMatrix to return the default viewing transform and, if successful, defines - via GpiSetDefaultViewMatrix - the returned value as the new default transform.
<pre>
<pre>
#define INCL_GPITRANSFORMS /* Transform functions */
#define INCL_GPITRANSFORMS /* Transform functions */
#include &lt;os2.h&gt;
#include <os2.h>


BOOL fSuccess; /* success indicator */
BOOL fSuccess; /* success indicator */
Line 67: Line 44:
}
}
</pre>
</pre>


[[Category:Gpi]]
[[Category:Gpi]]

Latest revision as of 21:47, 17 November 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

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