Differences between Android 0.1 degrees-Matrix

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.