Advertisement
metalx1000

Circle - Basic

Jun 28th, 2013
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.58 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html>
  3.   <head>
  4.   </head>
  5.   <body>
  6.         <canvas id="MyCanvas" width="600" height="300"></canvas>
  7.  
  8.         <script>
  9.                 var canvas = document.getElementById('MyCanvas');
  10.                 var context = canvas.getContext('2d');
  11.         var x = canvas.width / 2;
  12.         var y = canvas.height / 2;
  13.         var radius = 75;
  14.  
  15.         context.beginPath();
  16.         context.arc(x, y, radius, 0, 2 * Math.PI, false);
  17.         context.lineWidth = 15;
  18.         context.strokeStyle = "Blue";
  19.         context.fillStyle = 'Red';
  20.         context.fill();
  21.         context.stroke();
  22.         </script>
  23.   </body>
  24. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement