Change RectF values after Matrix scalling

那年仲夏 提交于 2019-12-24 09:06:31

问题


When I draw following line my RectF and Matrix values are,

Matrix{[1.0, 0.0, 254.76411][0.0, 1.0, 388.6726][0.0, 0.0, 1.0]}
RectF(0.0, 0.0, 297.0, 379.0)

When I re scale like following pic, the values are,

Matrix{[3.0136142, 0.0, 48.238903][0.0, 3.0136142, 177.33151][0.0, 0.0, 1.0]}
RectF(0.0, 0.0, 297.0, 379.0)

Here I want change the right and bottom values of RectF based on Matrix, so it will look like following instead of looks like zoomed/blurred.

I know its possible, but I don't know how to do it, so I need some help.


回答1:


You can use the mapRect method from Matrix to get the current RectF values as following.

RectF rectF2 = new RectF();
matrix.mapRect(rectF2, rectF);

Here rectF2 is the current RectF.



来源:https://stackoverflow.com/questions/52015287/change-rectf-values-after-matrix-scalling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!