<!DOCTYPE HTML>
<html>
<head>
<title></title>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(function () {
var c = document.getElementById("myCanvas");
var cxt = c.getContext("2d");
var img = new Image();
img.src = "Jellyfish.jpg";
img.onload = function () {
cxt.drawImage(img, 0, 0);
}
});
</script>
</head>
<body>
<canvas id="myCanvas" width="1024" height="768" style="border: 1px solid #f00;">Your browser does not support the canvas element.
</canvas>
</body>
</html>
html5 canvas显示图片
最新推荐文章于 2024-07-04 00:07:08 发布