Path Text

Drawing Text Layout

Draws text on a path.

Сode Snippet

using (var bitmap = new Bitmap(400, 250, PixelFormat.Format24bppRgb, new RgbColor(255, 255, 255, 255)))
using (var graphics = bitmap.GetAdvancedGraphics())
{
    var pathText = new PathText("TEXT ON PATH", graphics.CreateFont("Arial", 36))
    {
        Pen = new Pen(RgbColor.Crimson, 1),
        Brush = new SolidBrush(new RgbColor(0x41, 0x41, 0x41)),
        ParagraphStyle = new ParagraphStyle() { Alignment = TextAlignment.Left },
        Stretch = false,
        Start = 0.2f,
        End = 1.0f,
        AutoExtend = false,
    };

    pathText.Path.MoveTo(26, 230);
    pathText.Path.CurveTo(126, 300, 226, 21, 426, 221);

    graphics.DrawPath(new Pen(RgbColor.Blue), pathText.Path);
    graphics.DrawText(pathText);

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

Output

PathText.png

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