OGeek|极客世界-中国程序员成长平台

标题: ios - 使用 UIImagePickerController 连续拍摄多张照片 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 18:27
标题: ios - 使用 UIImagePickerController 连续拍摄多张照片

UIImagePickerController可以一张一张的拍多张照片吗?

我知道有一个方法 takePicture 但我希望每秒拍摄 5-10 张照片。
例如,如果用户点击我的 UI 上的开始按钮,应用程序将继续以该速度拍摄图像,直到他们点击停止。我知道有很多应用程序会在一秒钟内拍摄很多照片,但我只是不知道它们在下面使用什么。

UIImagePickerController 是否可以实现,还是需要 AVFoundation?任何指向教程的指针或链接都会很棒。



Best Answer-推荐答案


我会看看 AVCaptureStillImageOutput class

确实是 AVFoundation 的一部分,我用这个方法非常成功,每 0.5 秒拍照一次:

- (void)captureStillImageAsynchronouslyFromConnectionAVCaptureConnection *)connection completionHandlervoid (^)(CMSampleBufferRef imageDataSampleBuffer, NSError *error))handler;

使用计时器尽可能多地调用此方法。

希望对您有所帮助。

关于ios - 使用 UIImagePickerController 连续拍摄多张照片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21536548/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4