Reputation: 21
i have an UIImageView that the user can rotate and resize touching the screen. I want apply the same changes the user has made on the UIImageView to the UIImage inside it. Then i will use the UIImage for masking another image.
Please can you explain me what is the correct procedure for doing that?
The main problem is that i can't apply directly the Affine Transformation Matrix of the UIImageView to the [UIImage CGImage], because they use a different coordinate system.
Upvotes: 1
Views: 1395
Reputation: 9076
The steps you have to take are:
Things you have to watch out for are the inverted co-ordinate system and the fact that the rotated image's bounding rectangle is now larger than the it originally was and you have to take this into account when creating your context.
See my earlier post: Creating a UIImage from a rotated UIImageView
Upvotes: 1