OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>drawImage() with SVG fragments</title> | |
3 <script> | |
4 onload = function() { | |
5 var context = document.getElementsByTagName('canvas')[0].getContext('2d' ); | |
6 fillStyles = [ "green", "red", "blue" ]; | |
7 fillStyles.forEach(function(fillStyle, i) { | |
8 context.fillStyle = fillStyle; | |
9 context.fillRect(i*60, i*60, 120, 120); | |
10 }); | |
11 } | |
12 </script> | |
13 <canvas width="240px" height="240px"></canvas> | |
OLD | NEW |