Rectangle in Android -


canvas.drawRect (left, top, right, bottom, paint);

Say that I want to draw the rectangle

x = 30 to x = 35 height y = 50 What will be the value in the above method Thank you very much.

Try:

  canvas.drawRect (30,035, 50, Reference_to_Paint_Object);  

It is assuming that you want to start the rectangle at the top of the screen. Change the 2 parameters to set top position. To pass the last parameter you must also create a paint object


Comments