Resolved Graphics.DrawString output quality

cbreemer

Well-known member
Joined
Dec 1, 2021
Messages
188
Programming Experience
10+
I was wondering about the butt-ugly appearance of the Graphics.DrawString() output. Then I found out (by accidentally plotting my bar chart wrongly) that it looks so much cleaner when painted over a red background. I wonder why that is, and how I could make it look presentable on a light background ? The command used is

graphics.DrawString(str, new Font("Arial", 8), Brushes.Black, x, y);

1.jpg
 
Also are you rendering to screen or rendering to an image and then showing the image? Right now it looks like you have some ClearType settings that drawing to an image, and then that image is being shown on screen.

Specifically one of the things to look at:
 
Thanks guys ! I had actually looked into the Graphics methods (and found nothing useful) but I quite overlooked the properties 😳
Indeed I am writing to an image. Now that I have added g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit; the text looks crisp and clear.
Problem solved ! Thanks again for your help.
 
Back
Top Bottom