-1

我是新手iOS,我想访问相机拍照。并将这些图片保存到自定义照片库中。通过谷歌搜索,我知道我想使用其中一个UIImagePickerControllerAVFoundation框架。如何访问相机并将图片保存到自定义照片库中UIImagePickerController

4

1 回答 1

0
-(IBAction)camaraBtnPress:(id)sender
{
    imagePickerController = [[UIImagePickerController alloc]init];
    imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePickerController.delegate = self;
    [self presentModalViewController:imagePickerController animated:YES];
}
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
    [imagePickerController dismissModalViewControllerAnimated:YES];
}

- (void)imagePickerController:(UIImagePickerController *)picker
        didFinishPickingImage:(UIImage *)image
                  editingInfo:(NSDictionary *)editingInfo
{
    [imagePickerController dismissModalViewControllerAnimated:YES];

    //to save in library
    UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
}

并按照此链接将照片保存在自定义相册中

于 2012-09-06T09:19:38.820 回答