截图
来源:互联网 发布:淘宝客服绩效考核标准 编辑:程序博客网 时间:2024/04/26 19:11
+ (UIImage *) imageFromView: (UIView *) theView
{
//Draw a view`s contents into an image context
UIGraphicsBeginImageContext(theView.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[theView.layer renderInContext:context];
UIGraphicsEndImageContext();
return theImage;
}
--此函数要用到QuartzCore.framework框架
//获得某个范围内的屏幕图像
- (UIImage *)imageFromView: (UIView *) theView atFrame:(CGRect)r
{
UIGraphicsBeginImageContext(theView.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
UIRectClip(r);
[theView.layer renderInContext:context];
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return theImage;//[self getImageAreaFromImage:theImage atFrame:r];
}
{
//Draw a view`s contents into an image context
UIGraphicsBeginImageContext(theView.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[theView.layer renderInContext:context];
UIGraphicsEndImageContext();
return theImage;
}
--此函数要用到QuartzCore.framework框架
//获得某个范围内的屏幕图像
- (UIImage *)imageFromView: (UIView *) theView atFrame:(CGRect)r
{
UIGraphicsBeginImageContext(theView.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
UIRectClip(r);
[theView.layer renderInContext:context];
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return theImage;//[self getImageAreaFromImage:theImage atFrame:r];
}
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 截图
- 《白骨精工作法》读后感
- IOS 触屏扫动实例
- TMS320F2812的存储器、系统启动与中断、时钟(PLL)
- <<敌戒>>
- 打印一个勾(c实现)
- 截图
- 七步实现directjngine、Ext Direct调用Java服务器端方法
- sync、fsync、fdatasync、fflush函数
- 给对象命名,用这种方法来共享对象。
- IOS 自动手势识别实例
- [算法学习]杨氏矩阵
- ARM在不同模式下如何区别同名寄存器(如fiq模式下的R8_fiq与其他模式下的R8),从而访问不同的寄存器
- 双向链表的快速排序
- UINavigationController与UITabBarController