document.getElementById('canvas');
canvas.width
canvas.height
var context=canvas.getContext("2d")
//使用...fillRect(x,y,width,height) //绘制填充矩形
strokeRect(x,y,width,height) //绘制带边框矩形
2.线条属性
1.lineWidth 线宽...” 折角
“round” 圆角
3.图形变换
save()
restore() //维持绘图的安全性
translate(x,y) //平移
rotate(deg) //旋转
scale...(sx,sy) //放缩
变换矩阵:
transform(a,b,c,d,e,f)
setTransform(a,b,c,d,e,f)
4.填充样式
1.fillStyle的值
fillStyle...gradient.addColorStop(1.0, "blue");
38 //gradient.addColorStop(1.0, "purple");
39 // 使用渐变线填充