---
title: "Double Path Text"
canonical: https://www.graphicsmill.com/samples/Text/TextLayout/DoublePathText_cs
product: "Graphics Mill"
source: "Text/TextLayout/DoublePathText.cs"
---

# Double Path Text

Demonstrates how to use double path text.

## Instruction

This code demonstrates how to draw text along two custom paths (top and bottom paths) using the `DoublePathText` class.
It creates a bitmap, sets up a top and bottom path, and positions the text along these paths, centering it between the two.
Additionally, the code draws both paths in blue and saves the result as an image file.

## Usings

```csharp
using Aurigma.GraphicsMill.Drawing;
```

## Code Snippet

```csharp
using (var bitmap = new Bitmap(400, 250, PixelFormat.Format24bppRgb, new RgbColor(255, 255, 255, 255)))
using (var graphics = bitmap.GetGraphics())
{
    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");
}
```

## Explanation

The code:

- Creates a 400x250 pixel bitmap with a white background.
- Defines a `DoublePathText` object to display the text "Double Path Text" with an "Arial" font of size 36, and centers it.
- Configures the top and bottom paths with custom curves to define the shapes the text will follow.
- Draws the text along these paths using the `graphics.DrawText()` method.
- Draws the paths in blue using `graphics.DrawPath()`.
- Saves the final image as "DoublePathText.png".

## Tags

- [Drawing](<https://www.graphicsmill.com/samples/tags/drawing_md>): Drawing vector shapes and text
- [Text Layout](<https://www.graphicsmill.com/samples/tags/text-layout_md>): Controlling advanced text layout

## Output

- [DoublePathText.png](<https://www.graphicsmill.com/samples/Text/compiled/Debug/DoublePathText_png>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.GetGraphics](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Bitmap_GetGraphics.htm.md>)
- [Aurigma.GraphicsMill.Drawing.DoublePathText](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_DoublePathText.htm.md>)
- [Aurigma.GraphicsMill.Drawing.DoublePathText.AutoExtend](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_DoublePathText_AutoExtend.htm.md>)
- [Aurigma.GraphicsMill.Drawing.DoublePathText.BottomPath](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_DoublePathText_BottomPath.htm.md>)
- [Aurigma.GraphicsMill.Drawing.DoublePathText.MainPath](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_DoublePathText_MainPath.htm.md>)
- [Aurigma.GraphicsMill.Drawing.DoublePathText.TopPath](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_DoublePathText_TopPath.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Graphics.CreateFont(String,Single)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Graphics_CreateFont_2_1dbfa9fa.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Graphics.DrawPath(Pen,Path)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Graphics_DrawPath_2_77634c23.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Graphics.DrawText(Text)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Graphics_DrawText_1_f576d03f.htm.md>)
- [Aurigma.GraphicsMill.Drawing.MainPath](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_MainPath.htm.md>)
- [Aurigma.GraphicsMill.Drawing.ParagraphStyle](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_ParagraphStyle.htm.md>)
- [Aurigma.GraphicsMill.Drawing.ParagraphStyle.Alignment](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_ParagraphStyle_Alignment.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Path.CurveTo(Single,Single,Single,Single,Single,Single)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Path_CurveTo_6_1e65d9e1.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Path.MoveTo(Single,Single)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Path_MoveTo_2_427c5821.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Pen](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Pen.htm.md>)
- [Aurigma.GraphicsMill.Drawing.SolidBrush](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_SolidBrush.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Text.Brush](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_Text_Brush.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Text.ParagraphStyle](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_Text_ParagraphStyle.htm.md>)
- [Aurigma.GraphicsMill.Drawing.TextAlignment](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_TextAlignment.htm.md>)
