render high quality antialiased text
Published: 27. January 2009 | Updated: 26. September 2011License: Microsoft Public License (MS-PL)
Categories: GDI
Tags: C# GDI Text Winforms
Import namespaces
using System.Drawing; using System.Drawing.Text;
Code
// in control Graphics g = CreateGraphics(); g.TextRenderingHint = TextRenderingHint.AntiAlias; g.DrawString("Antialiasing with C#", new Font(FontFamily.GenericSerif, 30, FontStyle.Regular, GraphicsUnit.Pixel), Brushes.Red, new PointF(20, 50));
| Send us feedback about this snippet » |





