Could anyone perhaps tell me how exactly I could get a handle on an image that the user has just taken with the device camera? For instance, when the user captures an image, it is saved to the photo library, but you don’t know the exact name of the image file without going to the photo library an searching for the image. I want to get a handle on the image once it is taken and then pass it to an UIImage so that I could for instance immediately display it to the user.
Thank you
You have 2 options depending on what method you are using to capture the image.
If you are using the UIImagePickerController to capture a still image with the UIImagePickerControllerSourceTypeCamera set as the source. You will recieve a call to your DELEGATE when the picture has been taken.
Here you can find the picture which you can use to present it directly. (The picture is in the “info” dictionary)
https://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/CameraAndPhotoLib_TopicsForIOS/Articles/TakingPicturesAndMovies.html#//apple_ref/doc/uid/TP40010406
Check the code on that apple site to see how it is implemented.
Alternatively method number 2 is by using the AVFoundation Framework. However this requires you to configure much more even though it gives you more freedom to how you can set things.
At the end of the implementation you will get the picture like this:
Here the image is in the imageSamplerBuffer.
This approach can be found here: https://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html