LineTo function

The LineTo function draws a line from the current position up to, but not including, the specified point.

Syntax

BOOL LineTo(
  HDC hdc,
  int x,
  int y
);

Parameters

hdc

Handle to a device context.

x

Specifies the x-coordinate, in logical units, of the line's ending point.

y

Specifies the y-coordinate, in logical units, of the line's ending point.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

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.

Examples

For an example, see Drawing Markers.

Requirements

   
Windows version Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See Also

Line and Curve Functions

Lines and Curves Overview

MoveToEx

Polyline

PolylineTo