WeChat Mini Program API drawing·draw (drawing)
draw
Definition
Draw the description (path, transformation, style) previously in the drawing context into the canvas.
Tip: The drawing context needs to be created by wx.createCanvasContext(canvasId)
.
Parameters
Example
const ctx = wx.createCanvasContext('myCanvas') ctx.setFillStyle('red') ctx.fillRect(10, 10, 150, 100) ctx.draw() ctx.fillRect(50, 50, 150, 100) ctx.draw()
Example
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)