第1个回答 2013-12-18
var a = 10,wWidth = innerWidth, wHeight = innerHeight;
function drawImg(){
context.save();
context.translate(wWidth/2,wHeight/2);
a++;
context.rotate(a*Math.PI/360);
context.drawImage(img,0-wWidth/2,0-wHeight/2,wWidth,wHeight);
context.restore();
setTimeout(drawImg,20);
}
以图片中心点旋转