views:

446

answers:

1

This has been asked many times. But most answers are not applicable to the latest OS (3.0+) or they are "Apple will reject it".

What I need is to programmatically grab the image displayed in the preview of the UIImagePickerController without having the user take a photo and use the image - what I actually need is to get a screenshot of my app, which contains the camera in the background and other stuff on the foreground.

I have tried several methods, with the latest being: iterate through all the subviews of the UIImagePickerController.view and save them as images using the [view.layer renderInContext:] method. With this method, I can actually get all the controller's assets (the buttons etc) but I can never see the actual preview. Has anyone figured a way to do this in 3.0+ ?

+1  A: 

This has been answered in question 1317978 already. Also, have a look at the blog post describing live grabbing in sudoku solver

Heiko Behrens
Thanks for pointing those out.
Dimitris