我的应用程序如何保存并打开iPhone照片库中的照片?
答
你能做的最好的保存关闭在自己的应用程序所拍摄的照片可写目录,然后使用它...请注意,如果您多次保存到用户库,它将每次都会创建一个新的映像。
您可能需要提交与苹果Radar以允许对文件的直接访问,或给你一些参考,你可以用它来查看文件(看到例如EXIF)。
答
这使您可以将图像保存到相册:
// Adds a photo to the saved photos album. The optional completionSelector should have the form:
// - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo;
UIKIT_EXTERN void UIImageWriteToSavedPhotosAlbum(UIImage *image, id completionTarget, SEL completionSelector, void *contextInfo);
(示例代码:)
IImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
/// called function, alerts user when the image has been saved:
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
[ [ self parentViewController ] dismissModalViewControllerAnimated: YES];
}
我会那样做.__ – cduck 2010-01-04 07:48:51