gpi12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GpiQueryBoundaryData (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPICORRELATION
 
BOOL GpiQueryBoundaryData(hps, prcl)
HPS hps;        /* presentation-space handle              */
PRECTL prcl;    /* address of structure for boundary data */
 
The GpiQueryBoundaryData function retrieves the current boundary data.
Boundary data is the smallest rectangle in model space that encloses
previous graphics output. The previous output includes all output since the
application reset the boundary data by using the GpiResetBoundaryData
function or started accumulating boundary data by using the DCTL_BOUNDARY
option of the GpiSetDrawControl function.
 
The boundary data is inclusive, meaning some output may lie on one or more
edges of the given rectangle. If there has been no output, the boundary data
is empty. In this case, the values for the upper-right corner in the given
rectangle will be less than the values for the lower-left corner.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the presentation space.
 
prcl       Points to the RECTL structure that receives the boundary data.
 
Return Value
 
The return value is GPI_OK if the function is successful or GPI_ERROR if an
error occurred.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
the following:
 
     PMERR_INV_HPS
     PMERR_INV_MICROPS_FUNCTION
     PMERR_PS_BUSY
 
Example
 
This example uses the GpiQueryBoundaryData function to retrieve the
rectangle enclosing the output. The boundary data is then used to draw a
border around the output.
 
POINTL ptlStart = { 0, 0 };
POINTL ptlTriangle[3] = { 100, 100, 200, 0, 0, 0 };
RECTL rcl;
 
GpiSetDrawControl(hps,
    DCTL_BOUNDARY, DCTL_ON);          /* accumulate boundary data   */
 
GpiMove(hps, &ptlStart);              /* produce output             */
GpiPolyLine(hps, 3L, &ptlTriangle);
 
GpiQueryBoundaryData(hps, &rcl);      /* copy boundary data to rcl  */
if (rcl.xLeft < rcl.xRight) {         /* verify output exists       */
    ptlStart.x = rcl.xLeft; ptlStart.y = rcl.yBottom;
    GpiMove(hps, &ptlStart);          /* move to lower-right corner */
    ptlStart.x = rcl.xRight; ptlStart.y = rcl.yTop;
    GpiBox(hps, DRO_OUTLINE, &ptlStart, 0L, 0L);     /* draw border */
}
 
See Also
 
GpiResetBoundaryData, GpiSetDrawControl, WinGetLastError, RECTL