ios截图代码
来源:互联网 发布:保山学院网络教学平台 编辑:程序博客网 时间:2024/06/13 06:31
CGRect cutRect = CGRectMake(0, 0, _imageView.frame.size.width, _imageView.frame.size.width); //截图矩形
UIGraphicsBeginImageContextWithOptions(cutRect.size, YES, 0.0); //创建基于当前上下文
[_imageView.layer renderInContext:UIGraphicsGetCurrentContext()]; //渲染,这里是截取imageview显示的图片,如果是截屏则此处是self.view.layer
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext(); //要释放上下文,否则内存泄露
UIGraphicsBeginImageContextWithOptions(cutRect.size, YES, 0.0); //创建基于当前上下文
[_imageView.layer renderInContext:UIGraphicsGetCurrentContext()]; //渲染,这里是截取imageview显示的图片,如果是截屏则此处是self.view.layer
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext(); //要释放上下文,否则内存泄露
0 0
- iOS下截图代码
- IOS 截图代码
- iOS代码截图
- iOS 代码截图
- ios截图代码
- iOS 代码截图
- iOS实现截图的代码
- iOS:等比压缩截图代码
- iOS开发--使用代码截图
- iOS开发 代码截图相关
- iOS中等比压缩截图代码
- 【代码笔记】iOS-对UIView进行截图
- ios截图
- iOS 截图
- IOS 截图
- iOS 截图
- ios 截图
- iOS截图
- Linux权限
- plist苹果安装包实现
- 直接修改UIView的x,y,width,height...
- linux下头文件
- hdu5237 Base64(模拟)
- ios截图代码
- nyoj 组合数 32 (dfs)
- python mysql盲注小程序
- Android-Activity
- [iOS]隐藏NavigationBar和StatusBar
- Linux下的文件、文件夹加密方法
- Xocde插件制作小入门
- 一个常用的Android APP框架开发(下)
- 用Unity3D实现简易的AR Demo