Advertisement
andruhovski

Canvas Rect Demo

Jul 11th, 2013
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.47 KB | None | 0 0
  1. <html>
  2.  <head>
  3.   <script type="text/javascript">        
  4.     function createImage() {
  5.         var canvas = document.getElementById("canvas");
  6.         var ctx = canvas.getContext("2d");
  7.         ctx.strokeRect(20, 20, 50, 50);
  8.         ctx.fillRect(80, 80, 50, 50);
  9.        // for future changes
  10.     }
  11.   </script>
  12.  </head>
  13.  <body onload="createImage();">
  14.    <canvas id="canvas" style="border: 2px solid black" width="200" height="200"> </canvas>
  15.  </body>
  16. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement