使用C#HTML表格(文本)图像 [英] Html table (text) to image using C#
问题描述
任何人都可以点我在C#中的一些示例code为HTML表格转换为图像?我知道如何将文本转换为图像,但我需要精心打造格式化文本的图像。整个文本格式的HTML表格。
Can anyone point me to some sample code in C# for converting an html table to image? I know how to convert text to image but i need to create an image of well formatted text. The whole text is formatted in html table.
推荐答案
您可以使用WebBrowser.DrawToBitmap方法。下面是一个<一个href=\"http://pietschsoft.com/post/2008/07/C-Generate-WebPage-Thumbmail-Screenshot-Image.aspx\">example.因此,我会做的是动态创建一个页面,你想要的表,不过表,然后使用DrawToBitmap方法将其保存为图像文件。
You can use the WebBrowser.DrawToBitmap method. Here is an example. So what I would do is create a page dynamically with the table you want, and nothing but the table, then use the DrawToBitmap method to save it to an image file.
这篇关于使用C#HTML表格(文本)图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!