I need to convert text to image, using specified fonts, size, etc.
Looks like everything is ok when using standard DrawString method
but, when I'm trying to do it under Windows 7 I have my picture blurred
this is a screenshot from Windows XP / Windows 2008 server
http://testmyblog.ho.ua/pictures/xp.png
and this is from Windows 7
http://testmyblog.ho.ua/pictures/7.png
also I tried to play with System.Drawing.Imaging.Encoder.Quality;
but even with max value of EncoderParameter blur effect doesn't disappear
I have no idea where is the problem, hope that you will be able to help.

Recommended Answers

All 2 Replies

There are a couple things you can do:
1) Use TextRenderer.DrawText() and not Graphics.DrawString()
You did not specify if you were using .NET 2.0 or not, but if you are then you should use the TextRenderer class. The other method in the Graphics class does GDI which is not very good and outdated.
2) You can try and set the SmoothingMode to Antialiasing:

e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

use below option.
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.