Hi All, I am trying to save a rotated and scaled UIImageView as an UIImage in the position and with the zoom scale that the user edited too. But I can only manage to save the original image as it was before editing. How can I save the image as it is shown in the UIImageView with the same scaling and rotation? I have read that I need to use UIGraphicsGetCurrentContext() but I get the same original image saved ( but flipped ) and not the rotated one!! Suggestions and hints would be really helpfull. Thank You in advance. Al
(UIImage *)getImage
{
CGSize size = CGSizeMake(250, 250);
UIGraphicsBeginImageContext(size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGMutablePathRef path = CGPathCreateMutable();
// Add circle to path
CGPathAddEllipseInRect(path, NULL, CGRectMake(0, 0, 250, 250));
CGContextAddPath(context, path);
// ****************** touchImageView is my UIImageView ****************//
CGContextDrawImage(context, CGRectMake(0, 0, 250, 250), [touchImageView image].CGImage);
UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext();
// Clip to the circle and draw the logo
CGContextClip(context);
UIGraphicsEndImageContext();
return scaledImage;
}