美文网首页
Android RectF函数

Android RectF函数

作者: 禹雪 | 来源:发表于2017-01-01 11:28 被阅读0次

<pre>
public RectF (float left, float top, float right, float bottom)
</pre>
根据指定坐标创建一个长方形,需要注意的是,此函数没有边界检查,所以输入要确保bottom<top,left<right。
参数:
left 长方形左侧的x坐标
top 长方形顶的Y坐标
right 长方形右侧的X坐标
bottom 长方形底的Y坐标
例如:

RectF rf1 = new RectF(100,100,300,200);

在屏幕中的位置如图:

Paste_Image.png

可以理解为左上角为点(100,100),右下角为点(300,200)。相应的右上角为(300,100),左下角为(100,200)

参考:
http://blog.csdn.net/chenxu6/article/details/41399355

相关文章

网友评论

      本文标题:Android RectF函数

      本文链接:https://www.haomeiwen.com/subject/xttivttx.html