ID2D1CommandSink::DrawLine method (d2d1_1.h)

Draws a line drawn between two points.

Syntax

HRESULT DrawLine(
                 D2D1_POINT_2F    point0,
                 D2D1_POINT_2F    point1,
  [in]           ID2D1Brush       *brush,
                 FLOAT            strokeWidth,
  [in, optional] ID2D1StrokeStyle *strokeStyle
);

Parameters

point0

Type: D2D1_POINT_2F

The start point of the line.

point1

Type: D2D1_POINT_2F

The end point of the line.

[in] brush

Type: ID2D1Brush*

The brush used to fill the line.

strokeWidth

Type: FLOAT

The width of the stroke to fill the line.

[in, optional] strokeStyle

Type: ID2D1StrokeStyle*

The style of the stroke. If not specified, the stroke is solid.

Return value

Type: HRESULT

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Remarks

Additional References

Requirements

Requirement Value
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1_1.h
DLL D2d1.dll

See also

ID2D1CommandList::Stream

ID2D1CommandSink

ID2D1RenderTarget::DrawLine