Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. I check, compile and run every program. Contact me at: aviboots(AT)netvision.net.il
Hostgator 1 Penny

BlueHost Web Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

getflywheel wordpress hosting


Distribute your Resume to 500+ Job Boards & Recruiters


6,846 questions

9,748 answers

573 users

How to draw and fill circle in HTML5 and JavaScript

1 Answer

0 votes
<canvas id="myCanvas" width="200" height="200" style="border: #000000;">
</canvas>

<script>
var canvas = document.getElementById("myCanvas");
// canvas.getContext("2d") returns an object with methods and properties for drawing on the 
// canvas: circles, text, boxes, lines, and more.
var context = canvas.getContext("2d");

context.beginPath();
// context.arc(x, y, r, sAngle - Start, eAngle - End, counterclockwise - Optional);
context.arc(120, 90, 50, 0, 2 * Math.PI);

// context.fillStyle= color|gradient|pattern;
context.fillStyle = 'red';
context.fill();
context.lineWidth = 3;
// context.strokeStyle = color|gradient|pattern;
context.strokeStyle = '#00ff00';
context.stroke();
</script>



answered May 21, 2014 by avibootz
...