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 line's ending point
  int nYEnd   // y-coordinate of line's ending point
);
 

Parameters

hdc
Handle to a device context.
nXEnd
Specifies the x-coordinate of the line's ending point.
nYEnd
Specifies the y-coordinate 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: To get extended error information, call GetLastError.

Remarks

The coordinates of the line's ending point are specified in logical units.

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.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in wingdi.h.
  Import Library: Use gdi32.lib.

See Also

Lines and Curves Overview, Line and Curve Functions, MoveToEx, Polyline, PolylineTo