I need to create High Quality images on the server by putting on top of existing images some dynamic text (server-side). So far so good, I can do something like this:
Bitmap bitmap = new Bitmap(@"d:\Work\flowers.jpg");
Graphics g = Graphics.FromImage(bitmap);
//Set quality to High
g.CompositingQuality = CompositingQuality.HighQuality;
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.High;
//String to draw in Picture
g.DrawString("Text in Picture", new Font("verdana", 20), new SolidBrush(Color.YellowGreen), 20, 100);
But the results don't have the quality I expect and the quality that is needed to be printed.
Here are the samples (to see the exact differences please check the S-es):
Fist is image generated with System.Drawing.Graphics:
http://shadowcatcher.mindcast.com/showclip.php?clip=94p6zx8yzr.png
Second is image created with Paint.Net (which proves is possible to have high quality text on top of images):
http://shadowcatcher.mindcast.com/showclip.php?clip=e5aniuqkm5.png
I'd be grateful if you can recommend an HIGH QUALITY library alternative to System.Drawing.Graphics or to tell me if I'm missing something when using System.Drawing.Graphics
User1813094009 posted
Hi Thanks, it is close to what needs to be done, but also "newGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;" can be set. Tudor