UIGraphicsBeginImageContextWithOptions(view.frame.size, YES, 1.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData *imageData = UIImageJPEGRepresentation(image,1.0f);
return [UIImage imageWithData:imageData];
网友评论