问题
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