OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <canvas id="c" width="200" height="200"></canvas> |
| 3 <script> |
| 4 var canvas = document.getElementById("c"); |
| 5 var ctx = canvas.getContext("2d"); |
| 6 ctx.globalCompositeOperation = 'source-over'; |
| 7 ctx.fillStyle = 'black'; |
| 8 ctx.fillRect(50,50,200,100); |
| 9 ctx.globalCompositeOperation = 'source-in'; |
| 10 ctx.shadowColor = 'blue'; |
| 11 ctx.shadowBlur = 10; |
| 12 ctx.shadowOffsetX = -10; |
| 13 ctx.shadowOffsetY = -10; |
| 14 ctx.fillStyle = 'teal'; |
| 15 ctx.fillRect(100,100,100,100); |
| 16 </script> |
OLD | NEW |