DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Robert has posted 10 posts at DZone. View Full User Profile

Capture View As Image

08.23.2008
| 616 views |
  • submit to reddit
        // Capture a view as an image

UIGraphicsBeginImageContext( view.bounds.size );
[view.layer renderInContext:UIGraphicsGetCurrentImageContext()];
UIImage *renderedImage = UIGraphicsImageWithCurrentImageContext();
UIGraphicsEndImageContext();