Once we have told the canvas where
to start drawing from, we can then
start drawing our design. For creating a
line, we need to use the lineTo
method.
The lineTo
method takes two parameters.
The x-coordinate
, and the y-coordinate
of
the point till where we want to draw the
line beginning from our initial point
specified by the moveTo()
method.
In the example given below, play around
by changing the arguments in
the lineTo()
method.