Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script type="application/javascript">
- function draw() {
- var canvas = document.getElementById("canvas");
- if (canvas.getContext) {
- var ctx = canvas.getContext("2d");
- ctx.lineWidth = 5;
- ctx.strokeStyle = 'rgb(255,255,0)';
- ctx.beginPath();
- ctx.moveTo(0,0);
- ctx.lineTo(canvas.width, canvas.height);
- ctx.closePath();
- ctx.stroke();
- ctx.beginPath();
- ctx.moveTo(canvas.width, 0);
- ctx.lineTo(0, canvas.height);
- ctx.closePath();
- ctx.stroke();
- }
- }
- </script>
- </head>
- <body onload="draw();">
- <canvas id="canvas" width="150" height="150" style="background-color: black;"></canvas>
- </body>
- </html>
Add Comment
Please, Sign In to add comment