GpiQueryViewingLimits: Difference between revisions
Appearance
Created page with "This function returns the current value of the viewing limits, as set by the GpiSetViewingLimits function. ==Syntax== <PRE> #define INCL_GPITRANSFORMS /* Or use INCL_GPI, INC..." |
|||
Line 57: | Line 57: | ||
} | } | ||
fSuccess = GpiSetViewingLimits(hps, rclLimits); | fSuccess = GpiSetViewingLimits(hps, &rclLimits); | ||
</PRE> | </PRE> | ||
Revision as of 16:28, 25 February 2017
This function returns the current value of the viewing limits, as set by the GpiSetViewingLimits function.
Syntax
#define INCL_GPITRANSFORMS /* Or use INCL_GPI, INCL_PM, */ #include <os2.h> HPS hps; /* Presentation-space handle. */ PRECTL prclLimits; /* Viewing limits. */ BOOL rc; /* Success indicator. */ rc = GpiQueryViewingLimits(hps, prclLimits);
Parameters
- hps (HPS) - input
- Presentation-space handle.
- prclLimits (PRECTL) - output
- 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_IN_RETAIN_MODE (0x208C)
An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or draw-and-retain.
- PMERR_INV_DC_TYPE (0x2060)
An invalid type parameter was specified with DevOpenDC, or a function was issued that is invalid for a OD_METAFILE_NOQUERY device context.
Remarks
This function is invalid when the drawing mode (see GpiSetDrawingMode) is set to retain.
Example Code
In this example the model space clipping region width is reduced to 100 if it is greater.
#define INCL_GPITRANSFORMS #include <OS2.H> HPS hps; /* Presentation-space */ /* handle. */ RECTL rclLimits; /* viewing limits. */ BOOL fSuccess; fSuccess = GpiQueryViewingLimits(hps, rclLimits); if ((rclLimits.xRight - rclLimits.xLeft) > 100) { rclLimits.xRight = 100; rclLimits.xLeft = 200; } fSuccess = GpiSetViewingLimits(hps, &rclLimits);