当前位置:编程学习 > html/css >>

HTML5画布画图实例

<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>

 

 

\

补充:web前端 , HTML 5 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,