locked
Graphics drawstring high quality alternative RRS feed

  • Question

  • User1813094009 posted
    Hi guys

    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

    PS. Images are saved as PNG
    Tuesday, February 17, 2009 5:18 AM

All replies