Jump to content

GpiQueryViewingLimits

From EDM2
Revision as of 21:28, 1 May 2017 by Ak120 (talk | contribs) (Remarks)

This function returns the current value of the viewing limits, as set by the GpiSetViewingLimits function.

Syntax

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);