Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

7. Working with Images > Automating Camera Shots

Automating Camera Shots

There are times when you just want to use the camera to take a quick shot without user interaction. For example, you might write a utility that does time-lapse photography as you’re biking, or you may want to build an application that builds stop-motion animation. You can accomplish this by building an AVFoundation solution, but for a simpler approach, you can just use an image picker controller.

Two APIs enable this kind of capture. The showsCameraControls property allows you to hide the normal camera GUI, presenting a full-screen camera preview instead. Set this property to NO.

ipc.showsCameraControls = NO;

To programmatically capture an image rather than depend on user input, call the takePicture method. (Corresponding video methods are startVideoCapture and stopVideoCapture.) This begins the photo-acquisition process, just as if a user had pressed the snap button. When the photo is ready, the picker sends the imagePickerController:didFinishPickingMediaWithInfo: callback to its delegate. You cannot capture another picture until after this method is called.


You are currently reading a PREVIEW of this book.


Get instant access to over $1 million worth of books and videos.


Start a Free 10-Day Trial

  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint