CanvasContext.lineTo
Add a new point, and line the last specified point to the new point. stroke()
can be used to draw the line.
Parameters
It is Object type.
Property | Type | Description |
x | Number | The x coordinate of destination point. |
y | Number | The y coordinate of destination point. |
Sample Code
copy
//.js
const ctx = my.createCanvasContext('awesomeCanvas')
ctx.moveTo(10, 10)
ctx.rect(10, 10, 100, 50)
ctx.lineTo(110, 60)
ctx.stroke()
ctx.draw()