WeChat applet API drawing setStrokeStyle (set line style)


setStrokeStyle


Definition

Set the border color.

Tip: If fillStyle is not set, the default color is black.

Parameters

ParametersTypeDefinition
colorColor \Gradient Objectfill color

Example

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

201612241138086846.png