【1】【IOS】 截图

时间:2014-07-10 11:01:17   收藏:0   阅读:199
1 UIGraphicsBeginImageContext(self.view.bounds.size);// 设置上下文
2 
3 [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];4 
5 UIImage *image=UIGraphicsGetImageFromCurrentImageContext();//从当前上下文中获取image
6 
7 UIGraphicsEndImageContext();//关闭上下文
8 
9 UIImageWriteToSavedPhotosAlbum(image,self, nil, nil);//存到相册

 

【1】【IOS】 截图,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!