2011-05-23 71 views
0

我用这个代码拍照:拍照,并在保存到相册

-(IBAction) getPhoto:(id) sender { 
UIImagePickerController * picker = [[UIImagePickerController alloc] init]; 
picker.delegate = self; 

if((UIButton *) sender == choosePhotoBtn) { 
    picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; 
} else { 
    picker.sourceType = UIImagePickerControllerSourceTypeCamera; 
} 

[self presentModalViewController:picker animated:YES]; 

}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { 
    [picker dismissModalViewControllerAnimated:YES]; 
    imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; 
} 

,我想知道我可以保存这张照片是我拍到相册。

回答

1

结帐的UIKit Function Reference,使用:

UIImageWriteToSavedPhotosAlbum() 

用法:

UIImageWriteToSavedPhotosAlbum(theImage, nil, nil, nil); 
相关问题