开发者

iPhone rewrite image file

开发者 https://www.devze.com 2023-03-16 18:39 出处:网络
I would like to access an image file in the iPhone images directory. Then I would like to open this file as binary and be able to rewrite it.

I would like to access an image file in the iPhone images directory. Then I would like to open this file as binary and be able to rewrite it.

Assuming user has chosen this file using the UIImagePickerController, is it possible to do such thing using iPho开发者_如何转开发ne API?


http://developer.apple.com/library/ios/#DOCUMENTATION/AudioVideo/Conceptual/CameraAndPhotoLib_TopicsForIOS/Articles/PickinganItemfromthePhotoLibrary.html this tutorial will help you in getting UIImage from photo library.

Once you obtain the image, you can do custom modifications to the UIImage and save it to photo album using this API:

Adds the specified image to the user’s Camera Roll album.
void UIImageWriteToSavedPhotosAlbum (
   UIImage  *image,
   id       completionTarget,
   SEL      completionSelector,
   void     *contextInfo
);  

If you are looking to replace the existing photo from Photo library , there is no direct (or Apple Approved) way to do that. If you still want to do that, you can find path to photo library (/private/var/mobile/Media/DCIM/100APPLE) and try rewriting the photos.

0

精彩评论

暂无评论...
验证码 换一张
取 消