Created
January 27, 2012 05:42
-
-
Save mbeaty/1687232 to your computer and use it in GitHub Desktop.
iPhone Screenshot in code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Capture Screenshot - Need to verify this still works in iOS 5 | |
UIGraphicsBeginImageContext(self.view.bounds.size); | |
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
UIImage *screenshotImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
NSData *data = UIImageJPEGRepresentation(screenshotImage,self.jpegCompressionRate); | |
NSUInteger len = [data length]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment