Rectangle in Android
canvas.drawRect(left, top, right, bottom, paint);
Say I want to draw rectangle
x=30 to x=35 of height y=50. What would be the values in above开发者_运维问答 method. Thank you very much.
Try:
canvas.drawRect(30,0,35,50,Reference_to_Paint_Object);
This is assuming that you want the rectangle to start at the top of the screen. Change the 2nd parameter to set the top location. You will also need to construct a Paint object to pass to the last parameter.
精彩评论