您的位置:首页 > 编程语言

[摘抄]iphone开发秘籍里面的捕捉屏幕截图代码

2011-07-27 15:18 337 查看
+ (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框架
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: