May 19, 2021 WeChat Mini Program Development Document
Drawing interfaces and methods
lineTo
method adds a new point and then creates a line from the last specified point to the target point.
Tip:
Draw
stroke()
method
Parameters | Type | Description |
---|---|---|
Ⅹ | Number | The x coordinates of the target location |
Y | Number | The y coordinates of the target location |
const ctx = wx.createCanvasContext('myCanvas')
ctx.moveTo(10, 10)
ctx.rect(10, 10, 100, 50)
ctx.lineTo(110, 60)
ctx.stroke()
ctx.draw()