iphone - UIImage Rotation -


I display an image in UIImageView (within UIScrollView) that is also stored in CoreData.

In the interface, I want the user to rotate the picture 90 degrees. I also have to save in the coredata.

What should I run in the display? Scrollview, uiimageview or own image? (If possible, I would like to animate the rotation) but then I have to save the picture to the coredata.

I thought about changing the image orientation but this property is only readable.

To display only rotated images, you rotate the UIImageView.

You can put some metadata together, the image in the core data is telling which rotation should be applied.

Some image formats have a built-in rotation property. If you know the compressed image data format then you can see the specification and see if it supports it.

If you actually rotate the image pixels, then you have to do this manually, you can create a CGBitmapContext and change the image in it which rotates with the matrix, then from the bitmap Create a new image.


Comments