function drawImageByScale(scale){
var imageWidth=canvas.width*scale;
var imageHeight=canvas.height*scale;
var width=(canvas.width-imageWidth)/2;
var height=(canvas.height-imageHeight)/2;
context.drawImage(img,0,0,canvas.width,canvas.height,width,height,imageWidth,imageHeight);
alert(sx);
alert(sy);
}
谢谢,能具体说说嘛,对于优化这方面我不是很了解
不会的 但是 优化没那么好