canvas中遇到的理解问题

1、lineDashOffset
ctx.lineDashOffset = number
描述:
setLineDash 用于设置开始绘制虚线的偏移量. 数字的正负表示左右偏移.
2、createLinearGradient
createLinearGradient(x1, y1, x2, y2)
createLinearGradient 方法接受 4 个参数,表示渐变的起点 (x1,y1) 与终点 (x2,y2)。
注:1、createLinearGradient(0,0,0,50)渐变是从(0,0)到(0,50)代表纵向渐变
2、createLinearGradient(0,0,50,0)渐变是从(0,0)到(50,0)代表横向渐变
3、createLinearGradient(0,0,50,50)渐变是从(0,0)到(50,50)代表对角线渐变

posted @ 2018-01-26 17:31  Sarah119  Views(161)  Comments(0Edit  收藏  举报