Saving Image from UIImageView after manipulating Gestures

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 03:36:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!