I'm doing some tests about drawing text in .Net and I had the following results.
- The first string is a native Label with the
FlatStyle
set toSystem
- The second string is drawn using
Graphics.DrawString()
method - The last one is drawn using
TextRenderer.DrawText()
method
All cases use the default Windows Vista/7 font: Segoe UI, 9
As you can see, there is a difference between the second string and the others (it has less quality, and the anti alias is different). I have tried to configure anti-alias and the smoothing mode in the Graphics
object, without any result.
Is it possible to draw text usign Graphics.DrawString
and get the same quality than others methods?
Thanks in advance.
EDIT: I have reviewed the code with Reflector. I realized that Graphics.DrawString
uses gdiplus.dll calling method GdipDrawString() and TextRenderer.DrawText
uses user32.dll calling DrawTextExW
and DrawTextExA
.
Any comment about it?