Jump to content

GpiSetGraphicsField: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Ak120 (talk | contribs)
mNo edit summary
Line 6: Line 6:
==Parameters==
==Parameters==
;hps (HPS) - input : Presentation-space handle.
;hps (HPS) - input : Presentation-space handle.
;prclField (PRECTL) - input : Graphics field.
;prclField ([[PRECTL]]) - input : Graphics field.
:It is an error if the top coordinate is less than the bottom, or the right coordinate is less than the left.
:It is an error if the top coordinate is less than the bottom, or the right coordinate is less than the left.
:All values are in presentation-page units.
:All values are in presentation-page units.
Line 12: Line 12:
==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==  
Possible returns from WinGetLastError:
Possible returns from WinGetLastError:
 
: PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified.
; 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_PS_BUSY (0x20F4) : An attempt was made to access the presentation space from more than one thread simultaneously.
: PMERR_INV_GRAPHICS_FIELD (0x207A) : An invalid field parameter was specified with GpiSetGraphicsField.
; PMERR_INV_GRAPHICS_FIELD (0x207A) : An invalid field parameter was specified with GpiSetGraphicsField.
: PMERR_INV_COORDINATE (0x205B) : An invalid coordinate value was specified.
; PMERR_INV_COORDINATE (0x205B) : An invalid coordinate value was specified.


==Remarks==
==Remarks==
Line 28: Line 27:
The boundaries are inclusive, so that points on them are not clipped (removed). By default, no clipping is performed.
The boundaries are inclusive, so that points on them are not clipped (removed). By default, no clipping is performed.


'''Note:''' There are restrictions on the use of this function when creating SAA-conforming metafiles; see "MetaFile Resolutions" in the
;Note: There are restrictions on the use of this function when creating SAA-conforming metafiles; see "MetaFile Resolutions" in the Presentation Manager Programming Reference for more information.
Presentation Manager Programming Reference for more information.


==Example Code==
==Example Code==

Revision as of 21:54, 7 January 2024

This function sets the size and position of the graphics field in presentation page units.

Syntax

GpiSetGraphicsField (hps, prclField)

Parameters

hps (HPS) - input
Presentation-space handle.
prclField (PRECTL) - input
Graphics field.
It is an error if the top coordinate is less than the bottom, or the right coordinate is less than the left.
All values are in presentation-page 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_GRAPHICS_FIELD (0x207A) : An invalid field parameter was specified with GpiSetGraphicsField.
PMERR_INV_COORDINATE (0x205B) : An invalid coordinate value was specified.

Remarks

The graphics field specifies a clipping boundary within the presentation page.

The boundaries are inclusive, so that points on them are not clipped (removed). By default, no clipping is performed.

Note
There are restrictions on the use of this function when creating SAA-conforming metafiles; see "MetaFile Resolutions" in the Presentation Manager Programming Reference for more information.

Example Code

This example sets the graphics field to 400x400 with the left bottom corner at (25,25).

#define INCL_GPITRANSFORMS
#include <OS2.H>

HPS hps;    /* Presentation-space */
            /* handle. */

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

GpiSetGraphicsField(hps, &rclField);

Related Functions