I have a fullscreen UIImageView with a image in it set to AspectFill (full bleed), how can I save only the visible portion of the image when its using the Aspect Fill content mode?
CGRect visibleRect;
visibleRect.size= mImageView.frame.size;
CGImageRef cropped_img = CGImageCreateWithImageInRect(mImageView.image.CGImage, visibleRect);
UIImage *finalImage = [[UIImage alloc]initWithCGImage:cropped_img];
UIImageWriteToSavedPhotosAlbum(finalImage, nil, nil, nil);
This is my current code, cropping and saving works, its just not cropping correctly. Any ideas?