setFillStyle
定义
设置填充色。
Tip: 如果没有设置 fillStyle
,默认颜色为 black
。
参数
参数 | 类型 | 定义 | |
---|---|---|---|
color | Color \ | Gradient Object | 填充色 |
例子
const ctx = wx.createCanvasContext('myCanvas')
ctx.setFillStyle('red')
ctx.fillRect(10, 10, 150, 75)
ctx.draw()
转载本站内容时,请务必注明来自W3xue,违者必究。
设置填充色。
Tip: 如果没有设置 fillStyle
,默认颜色为 black
。
参数 | 类型 | 定义 | |
---|---|---|---|
color | Color \ | Gradient Object | 填充色 |
const ctx = wx.createCanvasContext('myCanvas')
ctx.setFillStyle('red')
ctx.fillRect(10, 10, 150, 75)
ctx.draw()
转载本站内容时,请务必注明来自W3xue,违者必究。
本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728
W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。