1 UIGraphicsBeginImageContext(self.view.bounds.size);
2
3 [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
4
5 UIImage *image= UIGraphicsGetImageFromCurrentImageContext();
6
7 UIGraphicsEndImageContext();
8
2
3 [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
4
5 UIImage *image= UIGraphicsGetImageFromCurrentImageContext();
6
7 UIGraphicsEndImageContext();
8
9 UIImageWriteToSavedPhotosAlbum(image, self, nil, nil);
添加头文件:
#import <QuartzCore/QuartzCore.h>
链接库文件:
QuartzCore