iOS 截屏并保存在本地
2016-04-01 00:00
288 查看
点击截取图片按钮触发下面的代码:
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(image,self, nil, nil);
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(image,self, nil, nil);
相关文章推荐
- iOS状态栏颜色修改
- AutoLayout三个重要的概念
- 适配iPad和iPhone
- CocoaPods + 自定义静态库 -> 多工程连编
- IOS博客项目搭建-09-OAuth02授权
- ios逆向小试牛刀之操作手记
- iOS开发之 [NSNull length]:unrecognized selector sent
- IOS开发探索(一):CocoalPods相关
- iOS - 自定义启动图
- iOS 对于block的理解
- IOS中 Block简介与用法(一)
- [置顶] block一点也不神秘————如何利用block进行回调
- iOS非常重要的 block回调
- iOS之单例模式初探
- iOS设置圆角图片的方法及对比
- iOS的JS和OC代码互相调用
- IOS学习 GCD 延时执行三种方法 并行/串行/主队列综合练习 队列组 shift+command+o快速查找
- OC阅读笔记八:分类(上)
- iOS常用设计模式
- 浅谈ios block(1)