Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js canvas draw polygon

var ctx = canvas.getContext('2d');
ctx.fillStyle = '#f00';
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(100,50);
ctx.lineTo(50, 100);
ctx.lineTo(0, 90);
ctx.closePath();
ctx.fill();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #canvas #draw #polygon
ADD COMMENT
Topic
Name
3+6 =