tags:

views:

446

answers:

2

Hello!

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

A: 

There is some code here that controls the iPhone camera. Does it help you?

Preet Sangha
+3  A: 

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.

Mike Chen
Thanks a lot, this's what i want~