小程序畫布設(shè)置填充色CanvasContext.setFillStyle
CanvasContext.setFillStyle(string|CanvasGradient color)
設(shè)置填充色。
從基礎(chǔ)庫 1.9.90 開始,本接口停止維護,請使用 CanvasContext.fillStyle 代替
小程序插件:支持
參數(shù)
string|CanvasGradient color
填充的顏色,默認顏色為 black。
代碼示例
const ctx = wx.createCanvasContext('myCanvas')
ctx.setFillStyle('red')
ctx.fillRect(10, 10, 150, 75)
ctx.draw()
作者:大學(xué)生新聞網(wǎng) 來源:大學(xué)生新聞網(wǎng)
- 小程序畫布繪制文本描邊
- CanvasContext.strokeText(string text, number x, number y, number maxWidth)
- 04-15 關(guān)注:3