微信小程序API 绘图·draw(进行绘图)
draw
定义
将之前在绘图上下文中的描述(路径、变形、样式)画到 canvas 中。
Tip: 绘图上下文需要由 wx.createCanvasContext(canvasId) 来创建。
参数
例子
const ctx = wx.createCanvasContext('myCanvas')
ctx.setFillStyle('red')
ctx.fillRect(10, 10, 150, 100)
ctx.draw()
ctx.fillRect(50, 50, 150, 100)
ctx.draw()
例子
const ctx = wx.createCanvasContext('myCanvas')
ctx.setFillStyle('red')
ctx.fillRect(10, 10, 150, 100)
ctx.draw()
ctx.fillRect(50, 50, 150, 100)
ctx.draw(true)
