本文介绍了UIImage在iPhone上保存带文件名的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将图像(如使用UIImageWriteToSavedPhotosAlbum()方法)与我选择的文件名保存到private / var文件夹中?
How can I save an image (like using UIImageWriteToSavedPhotosAlbum() method) with a filename of my choice to the private/var folder?
推荐答案
肯尼,你有答案!为了说明,我总是认为代码更有用。
Kenny, you had the answer! For illustration I always think code is more helpful.
//I do this in the didFinishPickingImage:(UIImage *)img method
NSData* imageData = UIImageJPEGRepresentation(img, 1.0);
//save to the default 100Apple(Camera Roll) folder.
[imageData writeToFile:@"/private/var/mobile/Media/DCIM/100APPLE/customImageFilename.jpg" atomically:NO];
这篇关于UIImage在iPhone上保存带文件名的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!