Double Path Text

Drawing Text Layout

Demonstrates how to use double path text.

Сode Snippet

using (var bitmap = new Bitmap(400, 250, PixelFormat.Format24bppRgb, new RgbColor(255, 255, 255, 255)))
using (var graphics = bitmap.GetAdvancedGraphics())
{
    var doublePathText = new DoublePathText("Double Path Text", graphics.CreateFont("Arial", 36))
    {
        Brush = new SolidBrush(new RgbColor(0x41, 0x41, 0x41)),
        ParagraphStyle = new ParagraphStyle() { Alignment = TextAlignment.Center },
        MainPath = MainPath.Bottom,
        AutoExtend = false,
    };

    doublePathText.TopPath.MoveTo(26, 71);
    doublePathText.TopPath.CurveTo(128, 162, 186, 21, 367, 64);

    doublePathText.BottomPath.MoveTo(26, 152);
    doublePathText.BottomPath.CurveTo(121, 177, 183, 68, 368, 157);

    graphics.DrawText(doublePathText);
    graphics.DrawPath(new Pen(RgbColor.Blue), doublePathText.TopPath);
    graphics.DrawPath(new Pen(RgbColor.Blue), doublePathText.BottomPath);

    bitmap.Save("DoublePathText.png");
}

Output

DoublePathText.png

For AI-assisted development: Download Graphics Mill Code Samples XML Catalog