0

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.

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Mbt925
0

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;
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.