Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <head>
- <meta charset="utf-8">
- <title>Canvas</title>
- <script>
- function rysuj(){
- var k =canvas=document.getElementById("canvas");
- var k =canvas.getContext("2d");
- k.beginPath();
- k.rect(0,0,300,100);
- k.fillStyle="white";
- k.fill();
- k.beginPath();
- k.rect(0,100,300,200);
- k.fillStyle="red";
- k.fill();
- var podpis=document.getElementById("podpis");
- var k2=podpis.getContext("2d");
- k2.font='20pt Arial';
- k2.fillStyle='green';
- k2.fillText('Polska',110,25);
- }
- </script>
- </head>
- <body onload="rysuj();">
- <canvas id="canvas" width="300" height="200" style="border: 1px solid black;">
- </canvas>
- <br>
- <canvas id="podpis" width="300" height="50">
- </canvas>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement