---
title: "Vertical Text"
canonical: https://www.graphicsmill.com/samples/Text/TextLayout/VerticalText_cs
product: "Graphics Mill"
source: "Text/TextLayout/VerticalText.cs"
---

# Vertical Text

Draws different vertical texts.

## Instruction

This code demonstrates how to display vertical text both within a rectangular shape and at a specific point using `ShapeTextFrame` and `PointTextFrame`.
The `ShapeTextFrame` is used with a rectangular path, while the `PointTextFrame` places the text at a specified point in the canvas.
The text in both frames is oriented vertically.

## Usings

```csharp
using Aurigma.GraphicsMill.Drawing;
```

## Code Snippet

```csharp
using (var bitmap = new Bitmap(500, 500, PixelFormat.Format32bppArgb, RgbColor.White))
using (var gr = bitmap.GetGraphics())
{
    var text = new Text();
    text.String = Texts.LoremIpsum;
    text.CharStyle.Size = 20;

    var shape = new Path();
    shape.DrawRectangle(200, 50, 300, 300);

    text.Frames.Add(new ShapeTextFrame()
    {
        Shape = shape,
        TextOrientation = TextOrientation.Vertical,
    });

    text.Frames.Add(new PointTextFrame()
    {
        Point = new System.Drawing.PointF(50, 50),
        TextOrientation = TextOrientation.Vertical,
    });

    gr.DrawText(text);

    bitmap.Save("VerticalText.png");
}
```

## Explanation

The code:

- Creates a rectangular path (300x300 pixels) and places text within it using `ShapeTextFrame` with vertical orientation.
- Also adds a `PointTextFrame` with vertical orientation, where the text is placed at a specified point.
- Both text placements are rendered on the canvas and saved as "VerticalText.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

- [VerticalText.png](<https://www.graphicsmill.com/samples/Text/compiled/Debug/VerticalText_png>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.GetGraphics](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Bitmap_GetGraphics.htm.md>)
- [Aurigma.GraphicsMill.Drawing.CharStyle.Size](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_CharStyle_Size.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.Path](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Path.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Path.DrawRectangle(Single,Single,Single,Single)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Path_DrawRectangle_4_37f6c741.htm.md>)
- [Aurigma.GraphicsMill.Drawing.PointTextFrame](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_PointTextFrame.htm.md>)
- [Aurigma.GraphicsMill.Drawing.PointTextFrame.Point](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_PointTextFrame_Point.htm.md>)
- [Aurigma.GraphicsMill.Drawing.PointTextFrame.TextOrientation](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_PointTextFrame_TextOrientation.htm.md>)
- [Aurigma.GraphicsMill.Drawing.ShapeTextFrame](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_ShapeTextFrame.htm.md>)
- [Aurigma.GraphicsMill.Drawing.ShapeTextFrame.Shape](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_ShapeTextFrame_Shape.htm.md>)
- [Aurigma.GraphicsMill.Drawing.ShapeTextFrame.TextOrientation](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_ShapeTextFrame_TextOrientation.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Text](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Text.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Text.CharStyle](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_Text_CharStyle.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Text.Frames](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_Text_Frames.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Text.String](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_Text_String.htm.md>)
- [Aurigma.GraphicsMill.Drawing.TextOrientation](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_TextOrientation.htm.md>)
