从指定的view中截图 返回UIImage

-(UIImage *)getImageFromView:(UIView *)view{

    UIGraphicsBeginImageContext(view.bounds.size);

    [view.layerrenderInContext:UIGraphicsGetCurrentContext()];

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    return image;

}

原文地址:https://www.cnblogs.com/chenhaosuibi/p/3520292.html