gpt4 book ai didi

iphone - 如何使用objective c在一秒钟内拍摄并保存20张照片

转载 作者:搜寻专家 更新时间:2023-10-30 19:49:29 24 4
gpt4 key购买 nike

我正在创建一个照片拍摄应用程序,用户可以在其中一秒钟拍摄多达 20 张照片。我已经尝试过苹果的 AVCam 示例代码,但它不允许以 20 FPS 的速度拍摄静止图像。

有没有其他方法可以以这种速度拍照。

最佳答案

查看此演示.. Photo Picker

在此演示中,只需检查或引用这两个类..

  1. MyViewController.m
  2. OverlayViewController.m

OverlayViewController.m 类中的 timedTakePhoto 方法中,只需根据您的要求设置定时器,如下所示。

- (IBAction)timedTakePhoto:(id)sender
{
// these controls can't be used until the photo has been taken
self.cancelButton.enabled = NO;
self.takePictureButton.enabled = NO;
self.timedButton.enabled = NO;
self.startStopButton.enabled = NO;

if (self.cameraTimer != nil)
[self.cameraTimer invalidate];
_cameraTimer = [NSTimer scheduledTimerWithTimeInterval:0.03
target:self
selector:@selector(timedPhotoFire:)
userInfo:[NSNumber numberWithInt:kOneShot]
repeats:YES];
// set time with your requirement above

// start the timer to sound off a tick every 1 second (sound effect before a timed picture is taken)
if (self.tickTimer != nil)
[self.tickTimer invalidate];
_tickTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
target:self
selector:@selector(tickFire:)
userInfo:nil
repeats:YES];
}

希望您能从中得到启发,并根据您的要求使用此演示..

希望对你有帮助...

关于iphone - 如何使用objective c在一秒钟内拍摄并保存20张照片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13718225/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com