我正在处理贺卡的应用我已经拍摄了屏幕截图并保存在图库中,因此请提供适用于我的代码的任何建议和源代码
答案 0 :(得分:0)
像这样:
- (UIImage *) captureScreen {
UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
CGRect rect = [keyWindow bounds];
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[keyWindow.layer renderInContext:context];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
然后使用以下教程将图像保存到相机胶卷 http://mobiledevelopertips.com/camera/save-an-image-to-camera-roll.html