HTML5画布画图实例
程序员文章站
2022-04-19 10:40:46
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<img id="face" src="face.jpg" width="480" height="800" />
<canvas id="mycanvas" width="480" height="800">
你的浏览器不支持HTML5
</canvas>
<script type="text/javascript">
var c=document.getElementById("mycanvas");
var ctx=c.getContext("2d");
var img=document.getElementById("face");
ctx.drawImage(img,0,0);
</script>
</body>
</html>