开发者

Rectangle in Android

开发者 https://www.devze.com 2023-01-08 11:47 出处:网络
canvas.drawRect(left, top, right, bottom, paint); Say I want to draw rectangle x=30 to x=35 of height y=50.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号