---
title: "Double Outline"
canonical: https://www.graphicsmill.com/samples/Text/EnhancedText/DoubleOutline_cs
product: "Graphics Mill"
source: "Text/EnhancedText/DoubleOutline.cs"
---

# Double Outline

Demonstrates how to draw a text with double outline.

## Instruction

This code creates a bitmap with custom text drawn using double outlines, and saves the result as an image.

## Usings

```csharp
using Aurigma.GraphicsMill.Drawing;
```

## Code Snippet

```csharp
var bgColor = new RgbColor(23, 42, 88);
var fillColor = new RgbColor(254, 190, 16);

using (var bitmap = new Bitmap(600, 250, PixelFormat.Format24bppRgb, bgColor))
using (var fr = new CustomFontRegistry())
using (var gr = bitmap.GetGraphics())
{
    var psName = fr.Add("Jost-Regular.ttf")[0].PostscriptName;

    gr.FontRegistry = fr;

    var text = new PlainText("WOW", gr.CreateFont(psName, 190))
    {
        Position = new System.Drawing.PointF(10, 220),
    };

    text.Brush = null;
    text.Pen = new Pen(RgbColor.White, 15);
    text.Pen.LineJoin = Aurigma.GraphicsMill.Drawing.LineJoin.Round;

    gr.DrawText(text);

    text.Brush = new SolidBrush(fillColor);
    text.Pen = new Pen(bgColor, 5);
    text.Pen.LineJoin = Aurigma.GraphicsMill.Drawing.LineJoin.Round;

    gr.DrawText(text);

    bitmap.Save("DoubleOutline.png");
}
```

## Explanation

The code:

- Creates a `Bitmap` object with a custom background color (`RgbColor(23, 42, 88)`).
- Initializes a custom font registry and loads a font from a TrueType font file (`Jost-Regular.ttf`).
- Retrieves an `AdvancedGraphics` object from the bitmap for drawing.
- Defines the text "WOW" and sets the font to be used with a size of 190 points.
- The text is initially drawn with a white outline (pen) with rounded line joins, without a brush (so the text is hollow).
- The text is then drawn again, this time with a solid fill color (`RgbColor(254, 190, 16)`) and a background outline (pen) with a different color and thickness.
- The final result is saved as a new PNG file (`DoubleOutline.png`).

## Tags

- [Drawing](<https://www.graphicsmill.com/samples/tags/drawing_md>): Drawing vector shapes and text
- [Formatted Text](<https://www.graphicsmill.com/samples/tags/formatted-text_md>): XML-based formatted text syntax
- [Text](<https://www.graphicsmill.com/samples/tags/text_md>): Rendering and formatting text

## Input

- [Jost-Regular.ttf](<https://www.graphicsmill.com/samples/Text/compiled/Debug/Jost-Regular_ttf>) (download)

## Output

- [DoubleOutline.png](<https://www.graphicsmill.com/samples/Text/compiled/Debug/DoubleOutline_png>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.GetGraphics](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Bitmap_GetGraphics.htm.md>)
- [Aurigma.GraphicsMill.Drawing.CustomFontRegistry](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_CustomFontRegistry.htm.md>)
- [Aurigma.GraphicsMill.Drawing.CustomFontRegistry.Add(String)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_CustomFontRegistry_Add_1_bb3a7a4f.htm.md>)
- [Aurigma.GraphicsMill.Drawing.FontAddResult.PostscriptName](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_FontAddResult_PostscriptName.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.DrawText(Text)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Graphics_DrawText_1_f576d03f.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Graphics.FontRegistry](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_Graphics_FontRegistry.htm.md>)
- [Aurigma.GraphicsMill.Drawing.LineJoin](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_LineJoin.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Pen](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Pen.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Pen.LineJoin](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_Pen_LineJoin.htm.md>)
- [Aurigma.GraphicsMill.Drawing.PlainText](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_PlainText.htm.md>)
- [Aurigma.GraphicsMill.Drawing.PlainText.Position](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_PlainText_Position.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.Pen](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_Text_Pen.htm.md>)
