问题
I'm trying to save the image after manipulating it with move, pinch and rotate gestoures.
All I get is the real image no matter what I tried,
I tried with UIGraphicsBeginImageContextWithOptions on the UIView container and on the UIIMageView without success.
Hope someone can help on this one.
Thanks,
Itay
回答1:
You could try with this:
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0);
CGContextConcatCTM(UIGraphicsGetCurrentContext(), imageView.transform);
[imageView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
This is assuming your imageView
is transformed by means of a CGAffineTransform
applied to it.
来源:https://stackoverflow.com/questions/14758060/saving-image-from-uiimageview-after-manipulating-gestures