Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
446 views
in Technique[技术] by (71.8m points)

camera - How can I take a photo frequently with iPhone?

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!!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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!!!

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. Dump headers of a Private Library called 'PhotoLibrary'.

  2. Setup your project in XCode.

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

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

  5. In the timer's callback, run

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

  6. 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().

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...