GpiSetDefViewingLimits
This function specifies the default value of the viewing limits (see GpiSetViewingLimits).
Syntax
GpiSetDefViewingLimits(hps, prclLimits)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- prclLimits (PRECTL) - input
- Default viewing limits.
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_COORDINATE (0x205B)
- An invalid coordinate value was specified.
Remarks
The viewing limits are reset to their default value at the following times:
- When the presentation space is associated with a device context (see GpiAssociate).
- When GpiResetPS is issued.
- When drawing of a chained segment begins or ends (see GpiOpenSegment and GpiCloseSegment for more details).
The initial default value of the viewing limits, when the presentation space is first created, is no clipping. The default value can be changed by GpiSetDefViewingLimits. Changing the default values has an immediate effect on the current viewing limits, if these are currently set to the default value.
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
In this example the default model space clipping region width is set to 100.
#define INCL_GPIPRIMITIVES #include <OS2.H> HPS hps; /* Presentation-space */ /* handle. */ RECTL rclLimits; /* viewing limits. */ rclLimits.xRight = 100; rclLimits.xLeft = 100; GpiSetDefViewingLimits(hps, &rclLimits);