I want to render "Hello dalvir" to image format so that hello dalvir shows in开发者_Python百科 red color in image. How i can do it in C#.
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();
精彩评论