Advertisement
quiliro

HTML5 Tutorial: Drawing Circles and Arcs

Sep 11th, 2012
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.55 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.   <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
  5.     <title>HTML5 Tutorial: Drawing Circles and Arcs</title>
  6.   </head>
  7.   <body>
  8.     <canvas id="mycanvas" width="300" height="300">
  9.     </canvas>
  10.     <script type="text/javascript">
  11.       var canvas = document.getElementById('mycanvas');
  12.       var ctx = canvas.getContext('2d');
  13.       ctx.beginPath();
  14.       ctx.arc(100, 100, 50, 0, 2 * Math.PI, false);
  15.       ctx.fillStyle = "rgb(0, 0, 255)";
  16.       ctx.fill();
  17.     </script>
  18.   </body>
  19. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement