Created
January 4, 2015 14:09
-
-
Save yuanhao/77de5b959a3ca834f0d5 to your computer and use it in GitHub Desktop.
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
| UIGraphicsBeginImageContext(self.view.bounds.size); | |
| [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
| UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); | |
| CGRect rect = CGRectMake(250,61 ,410, 255); | |
| CGImageRef imageRef = CGImageCreateWithImageInRect([viewImage CGImage], rect); | |
| UIImage *img = [UIImage imageWithCGImage:imageRef]; | |
| UIImageWriteToSavedPhotosAlbum(img, nil, nil, nil); | |
| CGImageRelease(imageRef); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment