如何从网页生成图片 [英] How to produce a picture from a Web page

查看:130
本文介绍了如何从网页生成图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们:



我现在有一个问题,需要解决它!



我想要从网页上制作一张图片,让我们举个例子:当前的codeproject页面,我想将网页改成静态图片,并包含所有页面内容。



现在,我知道可以使用WebBrowser Control生成图片,但它有一些缺陷。所以,我需要别人的方法,希望你能帮我解决这个问题!!!



提前致谢!!!



BR,

Bo

Hi friends:

I have a question now, need to resolve it!

I want to produce a picture from a web page, let us to make a example: Current codeproject page, I want to change the web page into a static picture, and include all of page contents.

Now, I know that can use WebBrowser Control to produce the picture, but it have some defects. so, I need others methods, hope you can help me to resolve the matter!!!

Thanks in advance!!!

BR,
Bo

推荐答案

文章各种捕捉屏幕的方法解释了一些有趣的方法。



如果您需要所有webcontent而不是 curl 是您的首选。
The article Various methods for capturing the screen explains some interesting methods.

If you need all webcontent than curl is your first choice.


查看CDHtmlDialog用于显示html页面的类。该课程非常容易使用。您可以在此处找到与屏幕截图相关的代码。
Look into the CDHtmlDialog class to display the html page(s). That class is very easy to use. You can find code relating to screen shots here.


hi friends:



我自己解决了这个问题!



C#



使用winform webbrowser控件,



位图位图=新位图(wb.Width,wb.Height);

wb.DrawToBitmap(bitmap,new Rectangle(0,0,wb.Width,wb.Height));
hi friends:

I have resolve it problem by myself!

C#

Use winform webbrowser control,

Bitmap bitmap = new Bitmap(wb.Width, wb.Height);
wb.DrawToBitmap(bitmap, new Rectangle(0, 0, wb.Width, wb.Height));


这篇关于如何从网页生成图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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