亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

js+html5繪制圖片到canvas的方法

 更新時(shí)間:2015年06月05日 11:58:37   作者:pythoner  
這篇文章主要介紹了js+html5繪制圖片到canvas的方法,涉及html5元素操作的相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了js+html5繪制圖片到canvas的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="200" height="100"
style="border:1px solid #c3c3c3;">
Your browser does not support the HTML5 canvas tag.
</canvas>
<script type="text/javascript">
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
var img=new Image();
img.onload = function(){
ctx.drawImage(img,0,0);
};
img.src="img_flwr.png";
</script>
</body>
</html>

更多關(guān)于JavaScript相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《JavaScript動(dòng)畫(huà)特效與技巧匯總》《JavaScript運(yùn)動(dòng)效果與技巧匯總》及《JavaScript數(shù)據(jù)結(jié)構(gòu)與算法技巧總結(jié)

希望本文所述對(duì)大家的web程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論