Easy Tutorial
❮ Ev Onsubmit Tag Button ❯

HTML canvas stroke() Method

HTML canvas Reference Manual

Example

Draw a path, forming the shape of the red letter L:

JavaScript:


Browser Support

Internet Explorer 9, Firefox, Opera, Chrome, and Safari support the stroke() method.

Note: Internet Explorer 8 and earlier versions do not support the <canvas> element.


Definition and Usage

The stroke() method actually draws the path defined by moveTo() and lineTo() methods. The default color is black.

Tip: Use the strokeStyle property to draw in another color/gradient.

| JavaScript Syntax: | context.stroke(); | | --- | --- |

❮ Ev Onsubmit Tag Button ❯