How can I get the current angle of a skewed image?
The code I use to skew it is:
CGAffineTransform t = CGAffineTransformMake(1.0, 0.0, tan(angle*(M_PI/480)), 1.0, 0.0, 0.0);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try this:
Keypath is guesstimated, but should work. CGAffineTransformMake docs.
EDIT:
Looks like CGAffineTransform is translated into 4×4
CATransform3Dmatrix.transformis property ofCALayerof CATransform3Dtype.That means you can acces
m11..m44parameters with calls like:You’d still need to do some calculations to get your skew factor. You can derive equation for your c_factor from this great answer.