截取某个view
- (UIImage )viewSnapshot:(UIView )view
{
UIGraphicsBeginImageContext(view.bounds.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
image = [UIImage imageWithCGImage:CGImageCreateWithImageInRect(image.CGImage,view.bounds)];
return image;
}
转载请注明原文地址: https://www.6miu.com/read-35704.html