本文实例为大家分享了HTML5 canvas绘制图片的具体代码,供大家参考,具体内容如下
demo.js
drawImage();
}
function createcanvas() {
var CANVAS=document.getElementById('mycanvas');
context=CANVAS.getContext('2d');
}
}
function createcanvas() {
var CANVAS=document.getElementById('mycanvas');
context=CANVAS.getContext('2d');
}
function drawImage() {
var img=new Image();
img.onload=function() {
context.drawImage(img,200,200 );
}
img.src="img5.jpg";
}
demo.html