FOLLOW US
4dots Software CODE HELP BLOG

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);		
	}