UIView To Image

来源:互联网 发布:嵌入式跟单片机 编辑:程序博客网 时间:2024/06/06 18:25
- (UIImage *)imageWithView:(UIView *)view{    UIGraphicsBeginImageContext(view.bounds.size);    [view.layer renderInContext:UIGraphicsGetCurrentContext()];    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();    UIGraphicsEndImageContext();    return image;}

0 0