Guest User

Untitled

a guest
Jun 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.69 KB | None | 0 0
  1. <html>  
  2.  <head>  
  3.   <script type="application/javascript">  
  4.     function draw() {  
  5.       var canvas = document.getElementById("canvas");  
  6.       if (canvas.getContext) {  
  7.         var ctx = canvas.getContext("2d");  
  8.  
  9.         ctx.lineWidth = 5;
  10.         ctx.strokeStyle = 'rgb(255,255,0)';
  11.         ctx.beginPath();
  12.         ctx.moveTo(0,0);
  13.         ctx.lineTo(canvas.width, canvas.height);
  14.         ctx.closePath();
  15.         ctx.stroke();
  16.        
  17.         ctx.beginPath();
  18.         ctx.moveTo(canvas.width, 0);
  19.         ctx.lineTo(0, canvas.height);
  20.         ctx.closePath();
  21.         ctx.stroke();
  22.       }  
  23.     }  
  24.   </script>  
  25.  </head>  
  26.  <body onload="draw();">  
  27.    <canvas id="canvas" width="150" height="150" style="background-color: black;"></canvas>  
  28.  </body>  
  29. </html>
Add Comment
Please, Sign In to add comment