Advertisement
MusicFreak

asdasddsa

Oct 21st, 2013
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.01 KB | None | 0 0
  1. <html>
  2.         <head>
  3.         <script type="text/javascript">
  4.                 function drawShape() {
  5.                        var myCanvas = document.getElementById("myCanvas");
  6.                   var ctx = myCanvas.getContext("2d");
  7.                                
  8.                        ctx.beginPath();
  9.          ctx.moveTo(75,0);
  10.                ctx.lineTo(150,100);
  11.                ctx.lineTo(75, 200);
  12.                   ctx.lineTo(0,100);
  13.                                  
  14.             ctx.lineWidth = 1;
  15.              ctx.fillStyle = "rgb(102, 204, 0)";
  16.            ctx.strokeStyle = "rgb(0, 50, 200)";
  17.                                  
  18.            ctx.closePath();
  19.                                  
  20.  
  21.              ctx.fill();
  22.           ctx.stroke();
  23.                                  
  24.                         }
  25.                 </script>
  26.         </head>
  27.  
  28.         <body onLoad="drawShape()">
  29.                 <canvas id="myCanvas" width="300" height="300">
  30.  
  31.                </canvas>
  32.        </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement