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.
GpiDrawSegment (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_GPISEGMENTS
BOOL GpiDrawSegment(hps, idSegment)
HPS hps; /* presentation-space handle */
LONG idSegment; /* identifier of segment to draw */
The GpiDrawSegment function draws the specified segment. The function draws
the segments using the current draw controls (except correlation control),
as set by the GpiSetDrawControl function. The function does not affect
drawing modes or open segments.
GpiDrawSegment cannot be used in an area, path, or element bracket.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hps Identifies the presentation space.
idSegment Identifies the segment to draw. This parameter must be greater
than zero.
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_SEG_NAME
PMERR_PATH_INCOMPLETE
PMERR_PS_BUSY
PMERR_SEG_NOT_FOUND
PMERR_STOP_DRAW_OCCURRED
Example
This example uses the GpiDrawSegment function to draw segment 4:
POINTL ptlStart = { 0, 0 };
POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
GpiOpenSegment(hps, 4L); /* open the segment */
GpiMove(hps, &ptlStart); /* move to start point (0, 0) */
GpiPolyLine(hps, 3L, ptlTriangle); /* draw triangle */
GpiCloseSegment(hps); /* close the segment */
.
.
.
GpiDrawSegment(hps, 4L); /* draw segment #4 */
See Also
GpiCloseSegment, GpiDrawChain, GpiDrawDynamics, GpiDrawFrom,
GpiQuerySegmentNames, GpiSetDrawControl, WinGetLastError
♦