LineTo
The LineTo function draws a line from the current position up to, but not including, the specified point.
BOOL LineTo(
HDC hdc, // device context handle
int nXEnd, // x-coordinate of ending point
int nYEnd // y-coordinate of ending point
);
Parameters
hdc
[in] Handle to a device context.
nXEnd
[in] Specifies the x-coordinate, in logical units, of the line's ending point.
nYEnd
[in] Specifies the y-coordinate, in logical units, of the line's ending point.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Windows NT/2000/XP: To get extended error information, call GetLastError.
Remarks
The line is drawn by using the current pen and, if the pen is a geometric pen, the current brush.
If LineTo succeeds, the current position is set to the specified ending point.
Example Code
For an example, see Drawing Markers.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Gdi32.lib.
See Also
Lines and Curves Overview, Line and Curve Functions, MoveToEx, Polyline, PolylineTo
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Gdi32.lib.
See Also
Lines and Curves Overview, Line and Curve Functions, MoveToEx, Polyline, PolylineTo