1、兼容ie9+ 火狐 谷歌
2、canvas标签为行内块标签,如果要调整画布的大小一定在属性中调,不要在样式中调整
3、创建一个画笔:var gd = oC.getContext('2d');
4、移动画笔:gd.moveTo(x,y);
5、画条线(路径):gd.lineTo(x,y)
画矩形:gd.strokeRect(x,y,w,h)
画圆:gd.arc(x,y,r,start,end,false)
画图:gd.drawImage(oImg,x,y,w,h)
画图:gd.drawImage(oImg,sx,sy,sw,sh,dx,dy,dw,dh)
6、描边:gd.stroke()
7、调整画笔的颜色:gd.strokeStyle='red'
8、调整画笔的粗细: gd.lineWidth=10;
9、开启新的路径:gd.beginPath();
闭合路径:gd.closePath();
10、填充矩形:gd.fillRect(x,y,w,h)
11、填充颜色:gd.fillStyle='red'
12、填充:gd.fill()
13、清画布:gd.clearRect()
14、字体大小:gd.font="30px 黑体"
15、给canvas加事件:要判断范围
16、旋转:gd.rotate(度数) 默认旋转中心为画布的左上角
17、平移:gd.translate() 平移操作和旋转操作同时写时要写在rotate之前
18、防止变形之间的操作互相影响 加 gd.save() gd.restore()回到画布的初始状态
19、