码迷,mamicode.com
首页 > 移动开发 > 详细

ios截取当前屏幕

时间:2014-08-02 20:58:14      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:ios   snapshot   

ios截取当前屏幕

by 伍雪颖

- (UIImage *)getSnapshotImage {
    UIGraphicsBeginImageContextWithOptions(CGSizeMake(CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)), NO, 1);
    [self.view drawViewHierarchyInRect:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)) afterScreenUpdates:NO];
    UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return snapshot;
}


ios截取当前屏幕,布布扣,bubuko.com

ios截取当前屏幕

标签:ios   snapshot   

原文地址:http://blog.csdn.net/rainlesvio/article/details/38350853

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