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

0

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 Apr 15, 2023 at 00:19
Sign in to add a comment

0 Answers

0
📝 No answers yet!

Be the first to answer this interview question.

Your Answer

Sign in to post your answer and help the community.