Jump to content

GpiSetPageViewport: Difference between revisions

From EDM2
Created page with "This function sets the page viewport within device space. ==Syntax== <PRE> #define INCL_GPITRANSFORMS Or use INCL_GPI, INCL_PM,: #include <os2.h> HPS hps; ..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 2: Line 2:


==Syntax==
==Syntax==
<PRE>
GpiSetPageViewport(hps, prclViewport);
#define INCL_GPITRANSFORMS /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>
 
HPS hps;                    /* Presentation-space handle. */
PRECTL prclViewport;        /* Page viewport. */
BOOL rc;                    /* Success indicator. */
 
rc = GpiSetPageViewport(hps, prclViewport);
</PRE>


==Parameters==
==Parameters==
; hps (HPS) - input : Presentation-space handle.
;hps (HPS) - input : Presentation-space handle.
 
;prclViewport (PRECTL) - input : Page viewport.
; prclViewport (PRECTL) - input : Page viewport.
:The page viewport is specified in device units.
The page viewport is specified in device units.


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


==Errors==  
==Errors==  
Line 46: Line 36:
<PRE>
<PRE>
#define INCL_GPITRANSFORMS
#define INCL_GPITRANSFORMS
#include <OS2.H>
#include <os2.h>


HPS hps;          /* Presentation-space */
HPS hps;          /* Presentation-space */
Line 63: Line 53:


==Related Functions==
==Related Functions==
* [[GpiCreatePS]]
*GpiCreatePS
* [[GpiQueryPageViewport]]
*[[GpiQueryPageViewport]]


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

Revision as of 20:18, 1 March 2017

This function sets the page viewport within device space.

Syntax

GpiSetPageViewport(hps, prclViewport);

Parameters

hps (HPS) - input
Presentation-space handle.
prclViewport (PRECTL) - input
Page viewport.
The page viewport is specified in device units.

Return Code

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_PAGE_VIEWPORT (0x20AD)
An invalid viewport parameter was specified with GpiSetPageViewport.
PMERR_INV_COORDINATE (0x205B)
An invalid coordinate value was specified.

Remarks

The presentation page maps to the page viewport and together they define the device transform.

When a presentation space is associated with a device context, a default page viewport is set up.

The origin in device space is mapped to the bottom-left of the output media (window or paper, for example).

This function must not be issued when there is no device context associated with the presentation space.

This function is ignored if issued to a presentation space that is associated with a device context of type OD_QUEUED (with PM_Q_STD data), OD_METAFILE, orOD_METAFILE_NOQUERY.

Example Code

This example sets the area of the device in which the picture is displayed to page viewport within device space.

#define INCL_GPITRANSFORMS
#include <os2.h>

HPS hps;          /* Presentation-space */
                  /* handle. */
RECTL rclField = {25L,   /* x coordinate of left-hand edge of */
                         /* rectangle. */
                  25L,   /* y coordinate of bottom edge of */
                         /* rectangle. */
                  425L,  /* x coordinate of right-hand edge of */
                         /* rectangle. */
                  425L}; /* y coordinate of top edge of
                         /* rectangle. */

GpiSetPageViewport(hps, &rclField);

Related Functions