WeChat applet development documentation
/ 微信小程序API 繪圖setShadow(設(shè)置陰影樣式)
微信小程序API 繪圖setShadow(設(shè)置陰影樣式)
setShadow
定義
設(shè)置陰影樣式。
Tip: 如果沒有設(shè)置,offsetX 默認(rèn)值為0, offsetY 默認(rèn)值為0, blur 默認(rèn)值為0,color 默認(rèn)值為 black
。
參數(shù)
例子
const ctx = wx.createCanvasContext('myCanvas') ctx.setFillStyle('red') ctx.setShadow(10, 50, 50, 'blue') ctx.fillRect(10, 10, 150, 75) ctx.draw()