Which methods are used to draw a straight line on a Canvas?

Asked: Apr 15, 2023

Following methods are used to draw a straight line on a Canvas:

  1. moveTo(x,y) – It defines the starting co-ordinates of the line.
  2. lineTo(x,y) – It defines the ending co-ordinates of the line.
  3. The actual line is drawn with the help of a method like stroke()
Asked by brijesh

Answers (0)

No answers yet. Be the first to answer!