GpiSetGraphicsField: Difference between revisions
Appearance
Created page with "This function sets the size and position of the graphics field in presentation page units. ==Syntax== <PRE> #define INCL_GPITRANSFORMS →Or use INCL_GPI, INCL_PM,: #includ..." |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 2: | Line 2: | ||
==Syntax== | ==Syntax== | ||
GpiSetGraphicsField (hps, prclField) | |||
==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. | |||
==Return Code== | ==Return Code== | ||
; rc (BOOL) - returns : Success indicator. | ; rc (BOOL) - returns : Success indicator. | ||
::TRUE Successful completion | |||
::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_PS_BUSY (0x20F4) : An attempt was made to access the presentation space from more than one thread simultaneously. | |||
An invalid presentation-space handle was specified. | : PMERR_INV_GRAPHICS_FIELD (0x207A) : An invalid field parameter was specified with GpiSetGraphicsField. | ||
: PMERR_INV_COORDINATE (0x205B) : An invalid coordinate value was specified. | |||
An attempt was made to access the presentation space from more than one thread simultaneously. | |||
An invalid field parameter was specified with GpiSetGraphicsField. | |||
An invalid coordinate value was specified. | |||
==Remarks== | ==Remarks== | ||
Line 45: | 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 Presentation Manager Programming Reference for more information. | |||
Presentation Manager Programming Reference for more information. | |||
==Example Code== | ==Example Code== |
Latest revision as of 23:40, 7 April 2025
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);