操作手势后从UIImageView保存图像
我试图通过移动,捏和旋转手势操作后保存图像。
无论我尝试什么,我所得到的都是真实的图像,
我试图与UIViewBeginImageContextWithOptions在UIView容器和UIIMageView没有成功。
希望有人能帮助这个。
谢谢,
伊泰
你可以试试这个:
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0); CGContextConcatCTM(UIGraphicsGetCurrentContext(), imageView.transform); [imageView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
这是假设您的imageView
是通过应用CGAffineTransform
手段进行转换。