WeChat applet API drawing fillRect (fill rectangle)


fillRect


Definition

Fills a rectangle.

Tip: Use setFillStyle() to set the fill color of the rectangle. If not set, the default is black.

Parameters

QQ截图20170208140618.png

Example

const ctx = wx.createCanvasContext('myCanvas')
ctx.setFillStyle('red')
ctx.fillRect(10, 10, 150, 75)
ctx.draw()

201612241547173939.png