tags:

views:

630

answers:

1

I've seen a number of posts on UIGetScreenImage, however, not a complete working (short) code example.

If anyone has a code example, from the prototype definition to an actual call, that would be greatly appreciated.

Thanks

John

+2  A: 
CGImageRef UIGetScreenImage(void);

....

    CGImageRef screen = UIGetScreenImage();
    UIImage* screenImage = [UIImage imageWithCGImage:screen];
    CGImageRelease(screen); // you need to call this. 
                           // UIGetScreenImage violates the CF memory management rules.
    // Use screenImage as you like.
KennyTM
I've written a (short) complete working example that shows how to work with this method:http://iphonedevelopertips.com/user-interface/screen-capture-using-uigetscreenimage.html
John