How to convert contents of a hidden webview to uiimage?
In my application, I converted the contents loaded in a UIWebView to a UIImage and had shown it in an UIImageView.
Now what I want to do is have a hidden webview load contents from an URL, and then convert its contents into a UIImage.
Can any body pl开发者_StackOverflowease suggest a method?
#import <QuartzCore/QuartzCore.h>
UIGraphicsBeginImageContext(yourWebView.bounds.size);
[yourWebView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
精彩评论