gpi12.hlp (Table of Contents; Topic list)
GpiEndPath (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPIPATHS
 
BOOL GpiEndPath(hps)
HPS hps;    /* presentation-space handle */
 
The GpiEndPath function ends a path bracket──that is, it ends the sequence
of functions (starting with the GpiBeginPath function) that define the
outline of a path.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the presentation space.
 
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
one of the following:
 
     PMERR_INV_HPS
     PMERR_NOT_IN_PATH
     PMERR_PS_BUSY
 
Example
 
This example uses the GpiEndPath function to end a path bracket. When the
path bracket is ended, a subsequent call to the GpiFillPath function draws
and fills the path.
 
POINTL ptlStart = { 0, 0 };
POINTL ptlTriangle[] = { 100, 100, 200, 0 };
 
GpiBeginPath(hps, 1L);                  /* start the path bracket */
GpiMove(hps, &ptlStart);                /* move to starting point */
GpiPolyLine(hps, 2L, ptlTriangle);      /* draw the three sides   */
GpiCloseFigure(hps);                    /* close the triangle     */
GpiEndPath(hps);                        /* end the path bracket   */
GpiFillPath(hps, 1L, FPATH_ALTERNATE);  /* draw and fill the path */
 
See Also
 
GpiBeginPath, WinGetLastError