Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cutmail
Created September 30, 2011 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cutmail/1252292 to your computer and use it in GitHub Desktop.
Save cutmail/1252292 to your computer and use it in GitHub Desktop.
application screenshot from code
#import <QuartzCore/QuartzCore.h>
- (UIImage*) buildImageFrom: (UIView*)view {
UIGraphicsBeginImageContext(view .bounds.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage* viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return viewImage;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment