根据我的标题,我有一张2张照片,我想把它保存为一张照片。
其中一张照片允许用户进行手势,如旋转,缩放和移动。
如何保存用户移动和旋转的图片?
screen shot of the phone saved image
{{ 1}}
以下代码可参考 How to combine/ merge 2 images into 1
答案 0 :(得分:2)
试试这段代码
//Hide your views here like save button
CGRect screenRect = [[UIScreen mainScreen] bounds];
UIGraphicsBeginImageContext(screenRect.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, self, nil, nil);
//Show again your hidden views here like save button