Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script type="text/javascript">
- function drawShape() {
- var myCanvas = document.getElementById("myCanvas");
- var ctx = myCanvas.getContext("2d");
- ctx.beginPath();
- ctx.moveTo(75,0);
- ctx.lineTo(150,100);
- ctx.lineTo(75, 200);
- ctx.lineTo(0,100);
- ctx.lineWidth = 1;
- ctx.fillStyle = "rgb(102, 204, 0)";
- ctx.strokeStyle = "rgb(0, 50, 200)";
- ctx.closePath();
- ctx.fill();
- ctx.stroke();
- }
- </script>
- </head>
- <body onLoad="drawShape()">
- <canvas id="myCanvas" width="300" height="300">
- </canvas>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement