I was wondering if there was a specific method called when we press the 2 buttons of the iPhone (using Home-Button & Power on/off) to take a screenshot. If yes, I would known his name to use her in programming.
3 Answers
It is a system level service for which the app never receives any notification or method call.

- 162,346
- 23
- 271
- 359
-
Too bad for me, it was to answered at this question : [link](http://stackoverflow.com/questions/5947135/take-a-screenshot-from-the-camera-view) – Volg May 12 '11 at 15:11
I believe that would be a native method, not accessible from the IPhone SDK. In what context are you going to be using this? You might be looking for this - Take screenshot from code

- 1
- 1

- 6,163
- 6
- 56
- 83
There used to be a UIGetScreenImage()
function that you could use to capture the screen. Apple no longer allows use of that function in App Store apps, so you have a few other options. CALayer
has a -renderInContext:
method—Google it—that you can use to copy a view’s contents to a graphics context; this does not, however, work for OpenGL content, video, or live imagery from a device’s camera. I’m not sure about solutions for the first two, but for the latter—getting images from the camera—you’ll need to use the AVFoundation framework.

- 57,021
- 16
- 130
- 131
-
-
-
Yeah, it is. If you want to capture still images or video from the camera, you use AVFoundation. – Noah Witherspoon May 12 '11 at 17:11
-
I want to take a screenshot when the camera is running, I think AVFoundation is like the method takePicture(). – Volg May 13 '11 at 07:31