- -(void)saveScreen
- {
- CGRect myRect = [self.view bounds];
- UIGraphicsBeginImageContext(myRect.size);
- CGContextRef ctx = UIGraphicsGetCurrentContext();
- [[UIColor blackColor] set];
- CGContextFillRect(ctx, myRect);
- [self.view.layer renderInContext:ctx];
- UIImage *image1 = UIGraphicsGetImageFromCurrentImageContext();
- UIImageWriteToSavedPhotosAlbum(image1, nil, nil, nil);
- UIGraphicsEndImageContext();
- }
Please leave your comments here so that I can find out, if you find this snippet useful or not
Enjoy!
0 comments:
Post a Comment
Tweet