Skip to content

Commit ab5055f

Browse files
committed
Added canvas image test
1 parent 501f559 commit ab5055f

File tree

1 file changed

+28
-17
lines changed

1 file changed

+28
-17
lines changed

tests/images.html

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
<script type="text/javascript" src="../build/jquery.plugin.html2canvas.js"></script>
1111
<script type="text/javascript">
1212
$(window).ready(function() {
13+
var ctx = $('#testcanvas')[0].getContext('2d');
14+
15+
ctx.fillStyle = "rgb(200,0,0)";
16+
ctx.fillRect (10, 10, 55, 50);
17+
18+
ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
19+
ctx.fillRect (30, 30, 55, 50);
20+
1321
$('body').html2canvas();
1422
});
1523
</script>
@@ -35,23 +43,26 @@
3543

3644
</head>
3745
<body>
38-
46+
3947
<img src="image.jpg" />
40-
<img src="image.jpg" style="width:50px;height:400px;" />
41-
<img src="image.jpg" style="width:500px;" />
42-
<img src="image.jpg" style="width:500px;height:40px;" />
43-
44-
45-
<img src="image.jpg" style="padding:20px;border:5px solid black;" />
46-
47-
<img src="image.jpg" style="padding-bottom:20px;border-top:5px solid black;clear:both;" />
48-
49-
50-
<img src="image.jpg" style="padding-top:20px;border-top:5px solid black;clear:both;width:50px;" />
51-
<img src="image.jpg" style="padding-top:20px;border-top:5px solid black;clear:both;width:50px;height:25px;" />
52-
53-
<img src="image.jpg" style="width:0px;height:0px;border:1px solid black" />
54-
<img src="image.jpg" style="width:0px;height:0px;" />
55-
48+
<img src="image.jpg" style="width:50px;height:400px;" />
49+
<img src="image.jpg" style="width:500px;" />
50+
<img src="image.jpg" style="width:500px;height:40px;" />
51+
52+
53+
<img src="image.jpg" style="padding:20px;border:5px solid black;" />
54+
55+
<img src="image.jpg" style="padding-bottom:20px;border-top:5px solid black;clear:both;" />
56+
57+
58+
<img src="image.jpg" style="padding-top:20px;border-top:5px solid black;clear:both;width:50px;" />
59+
<img src="image.jpg" style="padding-top:20px;border-top:5px solid black;clear:both;width:50px;height:25px;" />
60+
61+
<img src="image.jpg" style="width:0px;height:0px;border:1px solid black" />
62+
<img src="image.jpg" style="width:0px;height:0px;" />
63+
64+
<canvas id="testcanvas" style="width:100px;height:100px;"></canvas>
65+
66+
5667
</body>
5768
</html>

0 commit comments

Comments
 (0)