HTML canvas beginPath() Method
Example
ctx.beginPath();
ctx.lineWidth = "5";
ctx.strokeStyle = "red";
ctx.moveTo(25, 75);
ctx.lineTo(125, 75);
ctx.stroke();
ctx.beginPath();
ctx.strokeStyle = "green";
ctx.moveTo(25, 25);
ctx.lineTo(125, 75);
ctx.stroke();
Meaning
The beginPath() method begins a path, or resets the current path.
Standard Syntax
JavaScript syntax:
context.beginPath();
Advertisement