How to improve the quality of printed text after using "graphics.DrawString"?

I have a problem with the quality of the text after printing! it is not smooth and does not smooth!

This is history:

I am creating graphics from a bitmap ( Graphics.FromImage (MyBitmap) ) and I think this is the starting point of my problem because I cannot use PrintPageEvenArg (e), but I have no other choice!

after that I start writing text on this graph:

After reading the answers to similar questions on this site and some others, I made some changes to my graphic properties, such as smoothingMode, TextRenderingHint, ... which they see in the sequel ... but, unfortunately, none of them helped me!

SolidBrush sb = new SolidBrush(Color.White); graphics.FillRectangle(sb,oRectangle); //it was suggested to be done before antialiases inorder to get effects graphics.TextRenderingHint = TextRenderingHint.AntiAlias; //I also tried ClearTypeGridFit graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; graphics.CompositingQuality = CompositingQuality.HighQuality; graphics.CompositingMode = CompositingQuality.SourceOver; graphics.DrawString(strValue, boxStyle.Font, sb, oRectangle, StringFormat); 

by smoothing I got a smoother edge, but I see a lot of extra pixel next to my text, and my text color seems lighter, so I can say that due to smoothing the edge, the text quality even got worse!

Plz help me! Thanx in advance :)

+2
source share
1 answer

Try using this solution (GraphicsPath). In my project, it works very well.

+2
source

All Articles