I'm writing an iPhone app with Cocoa in xcode. I can't find any tutorials or sample code that shows how to take photos with the built in camera. How do I do this? Where can I find good info?
Thanks!
I'm writing an iPhone app with Cocoa in xcode. I can't find any tutorials or sample code that shows how to take photos with the built in camera. How do I do this? Where can I find good info?
Thanks!
The UIImagePickerController class lets you take pictures or choose them from the photo library. Specify the source type as UIImagePickerControllerSourceTypeCamera.
See also this question previously asked: http://stackoverflow.com/questions/74113/access-the-camera-with-iphone-sdk
Use UIImagePickerController. There is a good tutorial on this here.
http://www.zimbio.com/iPhone/articles/1109/Picking+Images+iPhone+SDK+UIImagePickerController
You should set the source type to UIImagePickerControllerSourceTypeCamera or UIImagePickerControllerSourceTypePhotoLibrary. Note that these two types result in very different displays on the screen. You should test both carefully. In particular, if you are nesting the UIImagePickerController inside a UINavigationController, you can end up with multiple navigation bars and other weird effects if you are not careful.
See also this thread