OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script type="application/x-javascript"> | 3 <script type="application/x-javascript"> |
4 function draw() { | 4 function draw() { |
5 var ctx = document.getElementById('c').getContext('2d'); | 5 var ctx = document.getElementById('c').getContext('2d'); |
6 | 6 |
7 ctx.fillStyle = "rgb(200,0,0)"; | 7 ctx.fillStyle = "rgb(200,0,0)"; |
8 ctx.fillRect (10, 10, 55, 50); | 8 ctx.fillRect (10, 10, 55, 50); |
9 ctx.fillRect (310, 10, 55, 50); | 9 ctx.fillRect (310, 10, 55, 50); |
10 ctx.fillRect (10, 310, 55, 50); | 10 ctx.fillRect (10, 310, 55, 50); |
11 ctx.fillRect (310, 310, 55, 50); | 11 ctx.fillRect (310, 310, 55, 50); |
12 | 12 |
13 ctx.fillStyle = "rgba(0, 0, 200, 0.5)"; | 13 ctx.fillStyle = "rgb(0, 0, 200)"; |
14 ctx.fillRect (30, 30, 55, 50); | 14 ctx.fillRect (30, 30, 55, 50); |
15 ctx.fillRect (330, 30, 55, 50); | 15 ctx.fillRect (330, 30, 55, 50); |
16 ctx.fillRect (30, 330, 55, 50); | 16 ctx.fillRect (30, 330, 55, 50); |
17 ctx.fillRect (330, 330, 55, 50); | 17 ctx.fillRect (330, 330, 55, 50); |
18 } | 18 } |
19 </script> | 19 </script> |
20 </head> | 20 </head> |
21 <body onload="draw();"> | 21 <body onload="draw();"> |
22 <canvas id="c" width="600" height="600"></div> | 22 <canvas id="c" width="600" height="600"></div> |
23 </body> | 23 </body> |
24 </html> | 24 </html> |
OLD | NEW |