js ctx dash line

Solutions on MaxInterview for js ctx dash line by the best coders in the world

showing results for - "js ctx dash line"
Andrea
22 Oct 2016
1var canvas = document.getElementById("canvas");
2var ctx = canvas.getContext("2d");
3ctx.setLineDash([5, 3]);/*dashes are 5px and spaces are 3px*/
4ctx.beginPath();
5ctx.moveTo(0,100);
6ctx.lineTo(400, 100);
7ctx.stroke();
8
queries leading to this page
js ctx dash linejs ctx dash line