I want to render "Hello dalvir" to image format so that hello dalvir shows in red color in image. How i can do it in C#.
Asked
Active
Viewed 300 times
-2
-
2possible duplicate of [How to render Html to image format?](http://stackoverflow.com/questions/6302293/how-to-render-html-to-image-format) – jonsca Jun 13 '11 at 10:23
1 Answers
1
here is code...
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();

Muhammad Akhtar
- 51,913
- 37
- 138
- 191
-
I want use html directly like "hello davir " wil be in html tags that having the style to apply teh red color. I this case what i have to do? – Dalvir Saini Jun 13 '11 at 11:16