iOS 7屏幕截取功能API
在做屏幕截图时,可以将view的layer渲染到context上,然后保存为图片。iOS 还提供了一种更高效的方式:
?
- (UIImage *)snapshot:(UIView *)view
{
UIGraphicsBeginImageContextWithOptions(view.bounds.size,
YES
, 0);
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:
YES
];
UIImage *p_w_picpath = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return
p_w_picpath;
}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。