从view 获取image

来源:互联网 发布:oracle数据库下载安装 编辑:程序博客网 时间:2024/06/03 19:29

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

    UIGraphicsBeginImageContext(view.bounds.size);

    [view.layerrenderInContext:UIGraphicsGetCurrentContext()];

    UIImage *image =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

   return image;

}

0 0
原创粉丝点击