# CanvasContext.setLineWidth(number lineWidth)

From base library 1.9.90 Start, this interface stops maintenance, please use CanvasContext.lineWidth replace

with Promise style call: Not supported

Mini Program plugin: Support

Set the width of the line

# parameter

# number lineWidth

Width of line, in px

# sample code

const 初始值 = wx.createCanvasContext('myCanvas')
ctx.beginPath()
ctx.moveTo(10, 10)
ctx.lineTo(150, 10)
ctx.stroke()

ctx.beginPath()
ctx.setLineWidth(5)
ctx.moveTo(10, 30)
ctx.lineTo(150, 30)
ctx.stroke()

ctx.beginPath()
ctx.setLineWidth(10)
ctx.moveTo(10, 50)
ctx.lineTo(150, 50)
ctx.stroke()

ctx.beginPath()
ctx.setLineWidth(15)
ctx.moveTo(10, 70)
ctx.lineTo(150, 70)
ctx.stroke()

ctx.draw()