我正在尝试制作一个带有按钮的应用程序,该按钮将截取设备屏幕上绘制的对象的屏幕截图并将其保存在设备的照片库中...
我将如何做到这一点?有什么想法吗?
最佳答案
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenShotimage = UIGraphicsGetImageFromCurrentImageContext();
UIImageWriteToSavedPhotosAlbum(screenShotimage, nil, nil, nil);
UIGraphicsEndImageContext();
此代码将截取您的屏幕截图并将图像保存在照片库中
关于objective-c - 使用 UIButton 截取 UIView 的屏幕截图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8412077/