Html表(文本)使用C# [英] Html table (text) to image using C#
本文介绍了Html表(文本)使用C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以指点我在C#中的一些示例代码将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方法。以下是示例。所以我要做的是动态创建一个页面,你想要的表,除了表格,然后使用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.
这篇关于Html表(文本)使用C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文