iOS截屏
来源:互联网 发布:什么软件可以下载图片 编辑:程序博客网 时间:2024/05/21 04:17
UIWindow *screenWindow = [[UIApplication sharedApplication] keyWindow];
}
objective c 截屏代码
-(void)save{
UIGraphicsBeginImageCont
[mybackgroundview.layer renderInContext:UIGraphicsGetCurrentCont
UIImage *viewImage = UIGraphicsGetImageFromCu
UIGraphicsEndImageContex
UIImageWriteToSavedPhoto
}截取 您想要的一层
UIGraphicsBeginImageCont
[self.view.layer renderInContext:UIGraphicsGetCurrentCont
UIImage *viewImage = UIGraphicsGetImageFromCu
UIGraphicsEndImageContex
UIImageWriteToSavedPhoto
截取自定义的大小
iPhone开发应用中抓图程序案例实现是本文要介绍的内容,主要是通过代码来实现抓图程序,具体实现过程,一起来看详细代码。
- //获得屏幕图像
- -
(UIImage *)imageFromView: (UIView *) theView - {
-
-
UIGraphicsBeginImageCont ext(theView.frame.size); -
CGContextRef = UIGraphicsGetCurrentContext (); -
[theView.layer renderInContext:context]; -
UIImage * = UIGraphicsGetImageFromCurrentImageContext (); -
UIGraphicsEndImageContex t(); -
-
return theImage; - }
-
- //获得某个范围内的屏幕图像
- -
(UIImage *)imageFromView: (UIView *) theView atFrame:(CGRect)r - {
-
UIGraphicsBeginImageCont ext(theView.frame.size); -
CGContextRef = UIGraphicsGetCurrentContext (); -
CGContextSaveGState(context); -
UIRectClip(r); -
[theView.layer renderInContext:context]; -
UIImage * = UIGraphicsGetImageFromCurrentImageContext (); -
UIGraphicsEndImageContex t(); -
-
return theImage;//[self getImageAreaFromImage:theImage atFrame:r]; - }
- IOS 截屏
- IOS 截屏
- IOS 截屏
- ios截屏
- iOS截屏
- iOS 截屏
- iOS截屏
- iOS 截屏
- iOS 截屏
- IOS截屏
- iOS截屏
- ios 截屏
- iOS截屏
- iOS 截屏
- iOS 截屏
- iOS截屏
- iOS-截屏
- iOS 截屏
- 搭建简单的OSGI的hello world
- 设置虚拟linux系统的桥接网络
- eclipse插件卸载
- Point Cloud Library 1.7.2编译及使用详细教程
- 第1章 android发展史
- iOS截屏
- Android 自定义控件 轻松实现360软件详情页
- js实现获取当前时间的前几天日期
- sublimetext激活
- 关于STL扩展库的思考
- C语言中的结构体与C++中的类异同
- tp上mongo的配置
- 人脸识别核心算法
- 博客之初始感悟篇