era*_*uki 12 iphone sandbox uiimagepickercontroller uiimage save-image
如何将图像(如使用UIImageWriteToSavedPhotosAlbum()方法)与我选择的文件名保存到private/var文件夹中?
era*_*uki 17
肯尼,你有答案!为了说明我总是认为代码更有帮助.
//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];
Run Code Online (Sandbox Code Playgroud)
ken*_*ytm 10
UIImageWriteToSavedPhotosAlbum()仅用于保存到照片相机胶卷.要保存到自定义文件夹,您需要使用UIImageJPEGRepresentation()或将UIImage转换为NSData UIImagePNGRepresentation(),然后将此NSData保存到您喜欢的任何位置.
| 归档时间: |
|
| 查看次数: |
23697 次 |
| 最近记录: |