GpiEndArea

This function ends the construction of a shaded area.

Syntax
GpiEndArea (hps)

Parameters

 * hps (HPS) - input : Presentation-space handle.

Return Code

 * lHits (LONG) - returns : Correlation and error indicators.
 * GPI_OK Successful
 * GPI_HITS Correlate hits
 * GPI_ERROR Error.

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_NOT_IN_AREA (0x20DD) : An attempt was made to end an area using GpiEndArea or during segment drawing while not in an area bracket.
 * PMERR_COORDINATE_OVERFLOW (0x2014) : An internal coordinate overflow error occurred. This can occur if coordinates or matrix transformation elements (or both) are invalid or too large.

Remarks
The construction is started by the GpiBeginArea function. If necessary, a final line is constructed (to the starting point of the last figure) to close the area.

The current position is not changed, unless a closure line has to be drawn, in which case the current position is moved to the end point of the line.

Graphic Elements and Orders
Element Type: OCODE_GEAR Order: End Area

Example Code
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. 
 * 1) define INCL_GPIPRIMITIVES      /* GPI primitive functions */
 * 2) include 

HPS hps;                        /* presentation space handle */ POINTL ptlStart = { 0, 0 };     /* first vertex */ POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 }; /* vertices */

GpiBeginArea(hps, BA_NOBOUNDARY | BA_ALTERNATE); GpiMove(hps, &ptlStart); GpiPolyLine(hps, 3L, ptlTriangle); GpiEndArea(hps); 

Related Functions
Prerequisite Functions Related Functions
 * GpiBeginArea
 * GpiPop
 * GpiSetAttrMode
 * GpiSetAttrs
 * GpiSetBackColor
 * GpiSetBackMix
 * GpiSetColor
 * GpiSetDefAttrs
 * GpiSetMix
 * GpiSetPattern
 * GpiSetPatternRefPoint
 * GpiSetPatternSet