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