Using DrawString to draw text with no border

Posted by griegs on Stack Overflow See other posts from Stack Overflow or by griegs
Published on 2010-05-20T05:44:18Z Indexed on 2010/05/20 5:50 UTC
Read the original article Hit count: 308

Filed under:
|

I have this code;

    public static Image AddText(this Image image, ImageText text)
    {
        Graphics surface = Graphics.FromImage(image);
        Font font = new Font("Tahoma", 10);

        System.Drawing.SolidBrush brush = new SolidBrush(Color.Red);

        surface.DrawString(text.Text, font, brush, new PointF { X = 30, Y = 10 });

        surface.Dispose();
        return image;
    }

However, when the text is drawn onto my image it's red with a black border or shadowing.

How can I write text to an image without any border or shadow?

© Stack Overflow or respective owner

Related posts about c#

Related posts about system.drawing