<pre>
public RectF (float left, float top, float right, float bottom)
</pre>
根據(jù)指定坐標(biāo)創(chuàng)建一個(gè)長(zhǎng)方形,需要注意的是,此函數(shù)沒(méi)有邊界檢查,所以輸入要確保bottom<top,left<right。
參數(shù):
left 長(zhǎng)方形左側(cè)的x坐標(biāo)
top 長(zhǎng)方形頂?shù)腨坐標(biāo)
right 長(zhǎng)方形右側(cè)的X坐標(biāo)
bottom 長(zhǎng)方形底的Y坐標(biāo)
例如:
RectF rf1 = new RectF(100,100,300,200);
在屏幕中的位置如圖:

Paste_Image.png
可以理解為左上角為點(diǎn)(100,100),右下角為點(diǎn)(300,200)。相應(yīng)的右上角為(300,100),左下角為(100,200)