Matrix.mapRect()理解


RectF r = new RectF(50, 0, 100, 100);
Log.d("m1", "-r.left = " + r.left + ", right = " + r.right + ", top = "
		+ r.top + ", bottom = " + r.bottom);
Matrix m = new Matrix();
m.setScale(2, 3);

m.mapRect(r);
Log.d("m1", "-r.left = " + r.left + ", right = " + r.right + ", top = "
		+ r.top + ", bottom = " + r.bottom);		

 

上面這段代碼log如下:

D/m1      (20694): -r.left = 50.0, right = 100.0, top = 0.0, bottom = 100.0
D/m1      (20694): -r.left = 100.0, right = 200.0, top = 0.0, bottom = 300.0

 

所以mapRect是單獨對RectF的坐標點進行矩陣變換。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM