Regarding Erica Sadun’s iPhone Developer Cookbook, in Chapter 8, Exercise 14 Resize and Rotate: the example works just fine, I am able to rotate, resize and whatever. The issue is, how do you reference the altered image after it has been scaled, rotate? When attempting to save the photo, it is saved as the original photo and not the edited one.
Regarding Erica Sadun’s iPhone Developer Cookbook, in Chapter 8, Exercise 14 Resize and Rotate
Share
I assume you are resizing and rotating a
UIImageViewthat is visible on the device’s screen. If this is the case, then your manipulations are being applied as matrix transformations on theUIViewwhen it renders, and are not actually modifying the backing image at all. So if you want to save a snapshot of the image’s current state, then you need to draw your view into an appropriately-sizedCGContext, and then create a new image from that context.You may find these resources helpful:
How to render UIView into a CGContext
http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/