WeChat applet API drawing strokeRect (draw a rectangle, not filled)


strokeRect


Definition

Draw a rectangle (non-filled).

Tip: Use setFillStroke() to set the color of the rectangular line. If not set, the default is black.

Parameters

QQ截图20170208141007.png

Example

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

QQ截图20170208141018.png