This topic has not yet been rated - Rate this topic

LineTo function

Applies to: desktop apps only

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

Minimum supported server

Windows 2000 Server

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

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ