Font.Underline Property

Gets or sets a value that indicates whether the text is underlined.

Namespace: Aurigma.GraphicsMill.Drawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public bool Underline { get; set; }

Property Value

true if the text is underlined; otherwise, false. The default value is false.

Examples

C#
using (var bitmap = new Bitmap(300, 30, PixelFormat.Format24bppRgb, RgbColor.White))
{
    using (var graphics = bitmap.GetGraphics())
    {
        //Draw text
        var font = new Font("Futura Md BT", 20);
        font.Bold = false;
        font.Italic = true;
        font.Underline = true;
        font.Strikeout = false;
        font.HorizontalAlignment = HorizontalAlignment.Center;

        var brush = new SolidBrush(RgbColor.Red);

        graphics.DrawString("Sample text", font, brush, 150, 0);

        bitmap.Save(@"Images\Output\string.png");
    }
}

See Also

Reference