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.
GpiEndArea (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_GPIPRIMITIVES
LONG GpiEndArea(hps)
HPS hps; /* presentation-space handle */
The GpiEndArea function ends an area bracket──that is, it ends the sequence
of functions (starting with the GpiBeginArea function) that define the
outline of an area. The function automatically closes any open figure in the
area, if necessary, by drawing a line from the current position to the
starting point of the figure, then draws the area using the filling mode
specified by the GpiBeginArea function that started the area bracket.
The GpiEndArea function does not change the current position unless it must
draw a line to close a figure in the area. In this case the new position is
the last point in the line.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hps Identifies the presentation space.
Return Value
The return value is GPI_OK or GPI_HITS if the function is successful. (It is
GPI_HITS if the detectable attribute is set for the presentation space and a
correlation hit occurs.) The return value is GPI_ERROR if an error occurs.
Errors
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
PMERR_INV_HPS
PMERR_INV_IN_RETAIN_MODE
PMERR_NOT_IN_AREA
PMERR_PS_BUSY
Example
This example uses the GpiEndArea function to end an area bracket. The
function draws the area (a triangle) by filling the outline with the current
fill pattern.
POINTL ptlStart = { 0, 0 };
POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
GpiBeginArea(hps, BA_NOBOUNDARY | BA_ALTERNATE);
GpiMove(hps, &ptlStart);
GpiPolyLine(hps, 3L, ptlTriangle);
GpiEndArea(hps);
See Also
GpiBeginArea, WinGetLastError
♦