码迷,mamicode.com
首页 > 其他好文 > 详细

UIView TO UIImage

时间:2014-12-19 20:49:11      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:

+ (UIImage *) imageWithView:(UIView *)view
{
    UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0f);
    [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO];
    UIImage * snapshotImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return snapshotImage;
}



UIView TO UIImage

标签:

原文地址:http://my.oschina.net/qianglong/blog/358169

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!