var can1=document.getElementByIdx_x_x("can1");
var cxt1=can1.getContext("2d");
var deg=0;
var fps=60;
//首先绘制图片
var image=new Image();
image.src="images/ie.jpg";
image.οnlοad=function(){
cxt1.drawImage(image,0,0);
}
//下边为我们的旋转的函数
function move(){
//1,获取canvas的尺寸
var cw=can1.width;
var ch=can1.height;
//初始化变形矩阵
cxt1.setTransform(1,0,0,1,0,0);
//清空canvas
cxt1.clearRect(0,0,cw,ch);
//计算变形矩阵
var m11=Math.cos(deg*Math.PI/180);
var dx=(cw/2)-(cw*m11/2);
//变形矩阵的设置
cxt1.setTransform(m11,0,0,1,dx,0);
//将变形后的图形绘制入canvas中
cxt1.drawImage(image,0,0);
//旋转角度递增
deg++;
deg=deg60;
}
//使用timer定时绘制下一幅图
setInterval("move()",1000/fps);