Export (0) Print
Expand All

lineCap property

Gets or sets the current line cap style.

HTML Canvas 2D Context, Section 6Internet Explorer 9

 

Syntax

HRESULT value = object.put_lineCap(
            string
           v);HRESULT value = object.get_lineCap(
            string
          * p);

Property values

Type: string

butt

Default. A flat edge is put perpendicular to each end of the line with no cap added.

round

A semicircle or rounded end cap is added to each end of the line.

square

A square end cap is added to each end of the line.

Standards information

Remarks

The round and square styles for the ICanvasRenderingContext2D::lineCap property make the lines slightly longer. For round ends, the cap diameter equals the ICanvasRenderingContext2D::lineWidth value. The square style adds a rectangle with a width of 1/2 of ICanvasRenderingContext2D::lineWidth. Both the round and square styles add approximately 1/2 of the current ICanvasRenderingContext2D::lineWidth value to the end of a line. You should consider this addition if your graphics accuracy is critical.

Illustration of the arcTo example with tangent lines

See also

ICanvasRenderingContext2D::lineWidth

 

 

Community Additions

ADD
Show:
© 2014 Microsoft