我正在尝试让我的应用程序打开相机应用程序以保存照片。
从我的应用程序中,我正在启动相机应用程序以使用以下代码拍照:
-(IBAction)TakePhoto:(id)sender {
picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
[picker setSourceType:UIImagePickerControllerSourceTypeCamera];
[self presentViewController:picker animated:YES completion:NULL];
[picker release];
//save image??:
//UIImageWriteToSavedPhotosAlbum(UIImage *image, id completionTarget, SEL completionSelector, void *contextInfo);
}
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
image = [info objectForKey:UIImagePickerControllerOriginalImage];
[self dismissViewControllerAnimated:YES completion:NULL];
}
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[self dismissViewControllerAnimated:YES completion:NULL];
}
我的问题是,一旦按下按钮,相机就会出来并让我拍照。拍完照片后,图像就会显示出来,我可以选择“重拍”或“使用”。我的问题是,如果我单击“使用”,图像不会保存到相机胶卷中。是否有可能保存图像并最终将“使用”按钮更改为“保存”?
谢谢你的帮助!