您的位置:首页 > 其它

开发笔记 那些年追过的图片(七):屏幕截图

2013-09-13 13:58 232 查看
引入 动画库
#include <QuartzCore/QuartzCore.h>

-(UIImage * )imageFromView:(UIView *)theView
{
UIGraphicsBeginImageContext(theView.frame.size);
CGContextRef context =UIGraphicsGetCurrentContext();
[theView.layer renderInContext:context];
UIImage *theImage =
UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return theImage;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: