Draw circle in HTML: In this article I will show you how we can draw circle in HTML canvas. To draw circle in web page we will use Canvas API, we will draw the circle on canvas using the arc() method. Following is the simple example to draw circle on canvas:
Draw_circle.html
<!DOCTYPE html>
<html>
<body>
<canvas id="circleCanvas" width="350" height="200" style="border:1px solid;"></canvas>
<script>
var c = document.getElementById("circleCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.arc(75,40,30,0,2*Math.PI);
ctx.stroke();
</script>
</body>
</html>
0 Comment(s)