Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

lineCap property

Gets or sets the current line cap style.

HTML Canvas 2D Context, Section 6Internet Explorer 9


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

Property values

Type: string


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


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


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

Standards information


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



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.