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.
GpiLine (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_GPIPRIMITIVES
LONG GpiLine(hps, pptl)
HPS hps; /* presentation-space handle */
PPOINTL pptl; /* address of structure for the end point */
The GpiLine function draws a straight line from the current position to the
specified end point. The function then moves the current position to the end
point.
The function draws the line by using the current values of the line-color,
line-mix, line-width, and line-type attributes. These values are set by
using the GpiSetAttrs function.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hps Identifies the presentation space.
pptl Points to a POINTL structure that contains the end point of the
line.
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_COORDINATE
PMERR_INV_HPS
PMERR_PS_BUSY
Example
This example uses GpiLine to draw an X.
POINTL ptl[4] = { 0, 0, 100, 100, 0, 100, 100, 0 };
GpiMove(hps, &ptl[0]);
GpiLine(hps, &ptl[1]);
GpiMove(hps, &ptl[2]);
GpiLine(hps, &ptl[3]);
See Also
GpiMove, GpiPolyLine, GpiSetAttrs, GpiSetColor, GpiSetCurrentPosition,
GpiSetLineType, POINTL
♦