HTML5 drawing pictures to canvas

From , 5 Years ago, written in JavaScript, viewed 141 times.
URL https://pastebin.vip/view/21567958
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3c3c3;">
  6. Your browser does not support the HTML5 canvas tag.
  7. </canvas>
  8.  
  9. <script type="text/javascript">
  10. var c=document.getElementById("myCanvas");
  11. var ctx=c.getContext("2d");
  12. var img=new Image();
  13. img.onload = function(){
  14. ctx.drawImage(img,0,0);
  15. };
  16. img.src="img_flwr.png";
  17. </script>
  18. </body>
  19. </html>
  20.  
  21. //javascript/4748

Reply to "HTML5 drawing pictures to canvas"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website