LineTo
Collapse the table of content
Expand the table of content

LineTo function

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

Syntax


BOOL LineTo(
  _In_ HDC hdc,
  _In_ int nXEnd,
  _In_ int nYEnd
);

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 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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

See also

Lines and Curves Overview
Line and Curve Functions
MoveToEx
Polyline
PolylineTo

 

 

Show:
© 2016 Microsoft