- (UIImage*) imageWithUIView:(UIView*) view
{
UIGraphicsBeginImageContext(view.bounds.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[view.layer renderInContext:context];
UIImage* tImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return tImage;
}
注意:此方法不是线程安全的。使用时需注意!
网友评论