Easy Tutorial
❮ Prop Url Required Jsref Tojson ❯

HTML canvas beginPath() Method

Canvas Object

Example

Draw two paths on the canvas; one in green and one in purple:

JavaScript:


Browser Support

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

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


Definition and Usage

The beginPath() method begins a new path or resets the current path.

Tip: Use these methods to create paths: moveTo(), lineTo(), quadraticCurveTo(), bezierCurveTo(), arcTo(), and arc().

Tip: Use the stroke() method to draw the actual path on the canvas.

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


Canvas Object

❮ Prop Url Required Jsref Tojson ❯