IOS 截屏得到Image

来源:互联网 发布:电脑mac是什么意思 编辑:程序博客网 时间:2024/06/07 19:10
- (UIImage *)snapshot:(UIView *)view{    UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, 0);    [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();    UIGraphicsEndImageContext();     return image;}

0 0