Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <body>
- <canvas id="myCanvas" width="1000" height="1000">
- </canvas>
- <script>
- var c=document.getElementById("myCanvas");
- var ctx=c.getContext("2d");
- ctx.fillStyle="#FFDD40";
- ctx.fillRect(200,300,400,200);
- </script>
- <canvas id="myCanvas" width="200" height="100">
- </canvas>
- <script>
- var c=document.getElementById("myCanvas");
- var ctx=c.getContext("2d");
- ctx.fillStyle="#FF0000";
- ctx.fillRect(370,425,50,75);
- </script>
- <canvas id="myCanvas" width="200" height="100" >
- </canvas>
- <script>
- var c=document.getElementById("myCanvas");
- var ctx=c.getContext("2d");
- ctx.beginPath();
- ctx.arc(280,380,30,3.15,2*Math.PI);
- ctx.fillStyle="blue";
- ctx.fill();
- </script>
- <canvas id="myCanvas" width="200" height="100" >
- </canvas>
- <script>
- var c=document.getElementById("myCanvas");
- var ctx=c.getContext("2d");
- ctx.beginPath();
- ctx.arc(520,380,30,3.15,2*Math.PI);
- ctx.fillStyle="blue";
- ctx.fill();
- </script>
- <canvas id="myCanvas" width="700" height="700"></canvas>
- <script>
- var c=document.getElementById("myCanvas");
- var context=c.getContext("2d");
- context.fillStyle = "green";
- context.beginPath();
- context.moveTo(150, 200);
- context.lineTo(130, 300);
- context.lineTo(675, 300);
- context.lineTo(650, 200);
- context.fill();
- context.closePath();
- </script>
- <canvas id="myCanvas" width="200" height="100">
- </canvas>
- <script>
- var c=document.getElementById("myCanvas");
- var ctx=c.getContext("2d");
- ctx.fillStyle="#FF0000";
- ctx.fillRect(500,170,30,50);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement