开发者

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜