0

UIViewController在为 iPhone 和 iPad输入 a 后,我正在尝试实现以编程方式拍摄 X 数量照片的功能。我查看了UIImagePickerController但我不想展示相机控件并让用户点击一个按钮来只拍摄一张照片。有没有办法在输入a后捕获X数量的照片UIViewController并最终存储所有照片以供将来参考?

编辑

-(void)viewDidAppear:(BOOL)animated
{
    // Create image picker controller
    picker = [[UIImagePickerController alloc] init];

    if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
    {
        [picker setSourceType:UIImagePickerControllerSourceTypeCamera];
    }
    else
    {
        [picker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
    }

    // Set source to the camera
    picker.sourceType =  UIImagePickerControllerSourceTypeCamera;

    // Delegate is self
    picker.delegate = self;

    // Allow editing of image ?
    picker.allowsEditing = NO;

    //picker.showsCameraControls = NO;

    // Show image picker
    [picker animated:YES completion:nil];
}
4

2 回答 2

1

立即使用 takePicture 您不能拍摄多个快照,因为您必须使用一些视频录制并在特定帧或时间中获取快照,为您提供更多参考,您可以使用此苹果文档进行批量快照AVFoundation 编程指南

于 2013-04-23T04:04:47.827 回答
1

你可以尝试这样的事情:

int numberOfPhotos = 3; // Number of photos you want to take.
for ( int i = 0; i < numberOhPhotos; i++ )
{
    // Note that you should use some sort of a pause in between each photo.
    [picker takePicture];
}
于 2013-04-23T00:16:10.953 回答