如何使用 iPhone 频繁拍照? [英] How can I take a photo frequently with iPhone?

查看:23
本文介绍了如何使用 iPhone 频繁拍照?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先对不起我的英语不好!有什么方法可以用 iPhone 自动拍照吗?例如.我需要在 30 秒内拍摄 20 张照片!是否可以?我会很感激任何想法!

First sorry for my poor English! Are there any ways to take a photo automatically with iPhone? eg. I need to take 20 pics in 30 sec! Is it possible? I would appreciate any ideas!!

推荐答案

我英语也不好....随便什么...

I'm not good at English either.... and whatever...

如果您不打算通过编写自己的应用程序来做到这一点.没办法啊!!!

If you are not gonna do it by writing your own application. There's no way you can do that!!!

首先,您描述的频繁拍照需要私有api.这将使您的应用被 App Store 拒绝.如果没问题,请阅读以下说明.

First, taking photos frequently as you described needs private apis. That will make your app rejected from App Store. If that's okay, read the instructions below.

  1. 转储名为PhotoLibrary"的私有库的标题.

  1. Dump headers of a Private Library called 'PhotoLibrary'.

在 XCode 中设置您的项目.

Setup your project in XCode.

添加 [[PLCameraController sharedInstance] previewView] 到你的 UIWindow,在 applicationDidFinishLaunching:.

Add [[PLCameraController sharedInstance] previewView] to your UIWindow, in applicationDidFinishLaunching:.

创建一个 NSTimer,每 (30/20) 秒重复一次.

Create a NSTimer, repeats every (30/20) secs.

在定时器的回调中,运行

In the timer's callback, run

UIImage *image = [[PLCameraController sharedInstance] _createPreviewImage];

UIImage *image = [[PLCameraController sharedInstance] _createPreviewImage];

然后你会每 1.5 秒得到一个 UIImage.做任何你需要做的事情.您可能需要通过调用 UIImageWriteToAlbum() 将它们保存到相册.

Then you will get a UIImage every 1.5 second. Do whatever you need to do. You might need to save them to Photo Album by calling UIImageWriteToAlbum().

注意:这只会拍摄低分辨率的照片.不可能每 1.5 秒拍一张全分辨率照片.

Notice: This will only take photos of a low resolution. It's impossible to take full resolution photo per 1.5 second.

这篇关于如何使用 iPhone 频繁拍照?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆