C# 如何将html呈现为图像格式

C# 如何将html呈现为图像格式,c#,asp.net,C#,Asp.net,我想将“Hello dalvir”渲染为图像格式,以便Hello dalvir在图像中以红色显示。如何在C#中实现它。下面是代码 Font MyFont = new Font(FontFamily, Font,FontStyle.Bold, GraphicsUnit.Point); MyGraphics = Graphics.FromImage(bmpImage); MyGraphics.Clear(Color.FromName("Red")); MyGraphics.TextRendering

我想将“Hello dalvir”渲染为图像格式,以便Hello dalvir在图像中以红色显示。如何在C#中实现它。

下面是代码

Font MyFont = new Font(FontFamily, Font,FontStyle.Bold, GraphicsUnit.Point);
MyGraphics = Graphics.FromImage(bmpImage);
MyGraphics.Clear(Color.FromName("Red"));
MyGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;
MyGraphics.DrawString("Hello dalvir", MyFont,
                    new SolidBrush(Color.FromName("Red")), 0, 0);
MyGraphics.Flush();

可能重复的我想直接使用html,比如“hello Davier”,将出现在html标记中,该标记具有应用红色的样式。我知道这件事我该怎么办?