2013-07-07
Lead:Matrix is the processing of Image Rendering (rotation, contraction, translation, and so on) in Android. It seems that this method is used to flip books.
Body:
1. Rotate degrees degree, postrotate (float degrees, float PX, float Py) based on the coordinate (PX, Py)
2. Based on the coordinate (PX, Py), scale down according to the ratio of (sx, Sy), postscale (float Sx, float Sy, float PX, float Py)
====
Both methods are normal, but when the two are used together, there is a problem when degrees is 180 degrees. The image cannot be rotated for 180 degrees, but is not rotated.
Postrotate (180f, W/2, H/2 );
Postscale (0.48f, 0.48f, W/2,
H/2 );
Matrix: 180: Matrix{<G id = "1"> [-0.48,
-0.0, 480.0] [0.0,-0.48, 561.0] [0.0, 0.0, 1.0]}
====
Finally, I used the stupid method, and it would be okay if I used 180.1 degrees. I forgot about the linear algebra of the university, so I was too lazy to study it.
Postrotate (180.1f, W/2, H/2 );
Postscale (0.48f, 0.48f, W/2, H/2 );
Matrix: 180.1f: {[-0.47999924, 8.3774904e-4,479.68542] [-8.3774904e-4,-0.47999924, 561.4186] [0.0, 0.0, 1.0]}
Above!
End: 1) insist on writing a blog
2) Continue Learning Development
3) I am an IT programmer