lineto方法增加一个新点,然后创建一条从上次指定点到目标点的线。
lineto
tip: 用stroke()方法来画线条
stroke()
const ctx = wx.createcanvascontext('mycanvas') ctx.moveto(10, 10) ctx.rect(10, 10, 100, 50) ctx.lineto(110, 60) ctx.stroke() ctx.draw()