您的位置:首页 > 其它

当前窗口如何获取当前路径的图像

2014-06-16 23:41 169 查看
// 1> 开始图像上下文

UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 0.0);

// 2> 取得的当前上下文就是图像上下文本身了

CGContextRef ctx = UIGraphicsGetCurrentContext();

// 3> 使用图层渲染输出图像到上下文

[view.layer renderInContext:ctx];

// 4> 拿到图像

UIImage *result = UIGraphicsGetImageFromCurrentImageContext();

// 5> 关闭图像上下文

UIGraphicsEndImageContext();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: