<!DOCTYPE HTML>
<html>
<body>
<canvas id="myCanvas" width="800" height="500" style="border:3px solid #FFFF00;"></canvas>
<!--Setting of size of Canvas-->
<script>
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
context.strokeStyle = 'red';
<!--Setting of color of arc-->
var x = canvas.width / 2;<!--center of x axis-->
var y = canvas.height / 2;<!--center of y axis-->
var r = 150;
context.beginPath();
context.arc(x,y,r, 0, 2.0 * Math.PI, false);
context.fillStyle = 'yellow';
context.fill();
context.lineWidth = 5;
context.stroke();
</script>
</body>
</html>
No comments:
Post a Comment
Note: only a member of this blog may post a comment.