Facebook
From Little Baboon, 6 Years ago, written in Plain Text.
This paste is a reply to Untitled from Round Cassowary - view diff
Embed
Download Paste or View Raw
Hits: 366
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <canvas id="myCanvas" width="700" height="500" style="border:1px solid black;"></canvas>
  6.  
  7.  
  8. <img src="las.png"  id="las" hidden>
  9. <img src="wood.jpg"  id="wood" hidden>
  10.  
  11. <script>
  12. var canvas = document.getElementById("myCanvas");
  13. var c = canvas.getContext("2d");
  14.  
  15. c.beginPath();
  16. var img = document.getElementById("wood");
  17. var tekstura = c.createPattern(img, "repeat");
  18. c.fillStyle = tekstura;
  19. c.rect (0, 0, 700, 500);
  20. c.fill();
  21. c.closePath();
  22.  
  23. c.beginPath();
  24. var im = document.getElementById("las");
  25. c.drawImage(im, 0,200,700,300);
  26. c.closePath();
  27.  
  28. c.beginPath();
  29. c.arc (150, 150, 80, 0, 6.28);
  30. c.fillStyle = "yellow";
  31. c.fill();
  32.  
  33. </script>
  34. </body>
  35. </html>
  36.