WeChat applet API draws rect to create a rectangle
rect
Definition
Creates a rectangle.
Tip: Use the fill()
or stroke()
method to actually draw the rectangle into the canvas.
Parameters
Example
const ctx = wx.createCanvasContext('myCanvas') ctx.rect(10, 10, 150, 75) ctx.setFillStyle('red') ctx.fill() ctx.draw()