FOLLOW US
softpcapps Software CODE HELP BLOG



Freeware Open Source Windows Software Applications and Free Online Tools

For Windows 11 : Download and run .NET 3.5 Installer if the application is not running

How to Avoid Bad Text Rendering when Drawing Text

To avoid bad text rendering when drawing text you have to set the TextRenderingHint of the graphics object to System.Drawing.Text.TextRenderingHint.AntiAlias.
For example :
	
 
	using (Graphics g = Graphics.FromImage(bmp))
	{
		g.Clear(Color.LightGray);			

		g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;

		g.DrawString("hello world", this.Font, Brushes.Black, 50f, 50f);		
	}