如何将UIWebView的内容保存为图像 [英] How do I save the contents of a UIWebView as an image

查看:101
本文介绍了如何将UIWebView的内容保存为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 UIWebView 的内容保存为图像。我只保存了屏幕上可见的网页内容。

I want to save the content of UIWebView as an image. The code I have only saves the content of the webpage that is visible on the screen.

- (IBAction)saveImage:(id)sender
{
    UIGraphicsBeginImageContext(webCanvas.frame.size);
    [self.webCanvas.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *viewImage =UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    UIImageWriteToSavedPhotosAlbum(viewImage, nil,nil,nil);
}

我希望它能将整个网页保存在<$ c $中c> UIWebView 包括屏幕上不可见的网站部分。这可能吗?

I want it so it will save the whole webpage in the UIWebView including the part of the website that is not visible on screen. Is this possible?

推荐答案

您需要检查以下内容: -
当webview是的时,将UIWebview内容转换为UIImage大于屏幕
如何拍摄整个视图的iPhone屏幕截图,包括屏幕外的部分?
希望这会对您有所帮助。

You will need to check these:-
Convert UIWebview contents to a UIImage when the webview is larger than the screen
How to take an iPhone screenshot of entire view including parts off screen?
Hope this will help you.

这篇关于如何将UIWebView的内容保存为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆