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.
GpiCloseSegment (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPISEGMENTS
 
BOOL GpiCloseSegment(hps)
HPS hps;    /* presentation-space handle */
 
The GpiCloseSegment function closes the current segment. Closing a segment
does not delete the segment or affect output on the current device. If any
element bracket is open, GpiCloseSegment automatically closes it.
 
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_AREA_INCOMPLETE
     PMERR_IMAGE_INCOMPLETE
     PMERR_INV_HPS
     PMERR_INV_MICROPS_FUNCTION
     PMERR_INV_MODE_FOR_REOPEN_SEG
     PMERR_NO_CURRENT_GRAPHICS_SEG
     PMERR_NOT_IN_SRG
     PMERR_PATH_INCOMPLETE
     PMERR_PS_BUSY
 
Comments
 
You must explicitly end any area or path bracket before closing the segment.
Failing to end an area or path may invalidate the segment.
 
GpiCloseSegment resets the current viewing transformation to identity.
 
Example
 
This example uses the GpiCloseSegment function to close a segment. The
GpiOpenSegment opens the segment; GpiMove and GpiPolyLine draw a triangle.
 
POINTL ptlStart = { 0, 0 };
POINTL ptlTriangle[] = { 100,100, 200,0, 0,0 };
 
GpiOpenSegment(hps, 1L);             /* open the segment          */
GpiMove(hps, &ptlStart);             /* move to start point (0,0) */
GpiPolyLine(hps, 3L, ptlTriangle);   /* draw triangle             */
GpiCloseSegment(hps);                /* close the segment         */
 
See Also
 
GpiOpenSegment, WinGetLastError