如何在iPhone图库中存储高质量的图像?
我拍摄了 1 张高质量图像并将其存储到
UIImage *image = [[UIImage alloc] initWithData:imageData];
NSArray *docDirs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSAllDomainsMask, YES);
NSString *docDir = [docDirs objectAtIndex:0];
BOOL success = [UIImagePNGRepresentation(image) writeToFile:[docDir stringByAppendingPathComponent:@"test11.png"] atomically:YES];
我可以从 xcode Organizer 中看到的某个位置,图像分辨率非常高。 尺寸:2592 × 1936 ... 大小 6.1MB
我的问题是如何在 iPhone 库中存储高质量图像。我严格不允许存储压缩图像。我必须仅存储高清高质量图像。
请不要使用scaleAndRotateImage函数回复,因为它会压缩图像。
I have taken 1 high quality image and stored it to some place
UIImage *image = [[UIImage alloc] initWithData:imageData];
NSArray *docDirs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSAllDomainsMask, YES);
NSString *docDir = [docDirs objectAtIndex:0];
BOOL success = [UIImagePNGRepresentation(image) writeToFile:[docDir stringByAppendingPathComponent:@"test11.png"] atomically:YES];
I can see from xcode organizer the image resolution is very high quality.
Dimension: 2592 × 1936 ... size 6.1MB
My problem is how can I store high quality image in iphone Library. I am strictly not allowed to store compressed image. I have to store only HD high quality image.
Please do not reply with scaleAndRotateImage functions because it will compress image.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ALAssetsLibrary 类可以让您做到这一点。
ALAssetsLibrary class will let you do that.