Advertisement
Slassh

HTML5 Canvas Intro

Jan 21st, 2013
311
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.     <!-- Example code from http://www.slashgame.net/2011/05/display-image-on-canvas.html -->
  4.     <script>
  5.         var canvas = document.getElementById('canvas');
  6.         var context2D = canvas.getContext('2d');
  7.  
  8.         var img = new Image();
  9.         img.src = "http://www.blogger.com/img/logo40.png";
  10.         context2D.drawImage(img, 100, 50);
  11.     </script>
  12. </head>
  13. <body>
  14.     <canvas id="canvas" width="400" height="400">
  15.         Browser not compatible with HTML5 canvas
  16.     </canvas>
  17. </body>
  18. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement