---JS canvas学习笔记
Posted 有挫败才有成长
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了---JS canvas学习笔记相关的知识,希望对你有一定的参考价值。
context的fillStyle属性
fillStyle=color | gradient | image | canvas |video
strokeStyle也有上述属性。
1、color:#ffffff | #362 | rgba(100,100,100,0.8) | red
css可以使用的格式在此都可以使用
2、gradient
Linear Gradient
var grd=context.createLinearGradient(xstart,ystart,xend,yend);
Radial Gradient
var grd=context.createRadialGradient(x0,y0,r0,x1,y1,r1);
grd.addColorStop(stop,color);
3、image | canvas | video
createPattern(img,repeat-style)
createPattern(canvas,repeat-style)
createPattern(videa,repeat-style)
repeat-style:no-repeat | repeat-x | repeat-y | repeat
以上是关于---JS canvas学习笔记的主要内容,如果未能解决你的问题,请参考以下文章