This documentation is for the old version. Go to the latest Graphics Mill docs

Font.VerticalAlignment Property

Gets/sets vertical text alignment, i.e. value specifying how to locate the text string relatively Y-coordinate of the point of text output (which is retrieved to DrawString(String, Font, Pen, Brush, Int32, Int32) method).

Namespace: Aurigma.GraphicsMill.Drawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

Visual Basic
Public Property VerticalAlignment As VerticalAlignment
C#
public VerticalAlignment VerticalAlignment { get; set; }

Property Value

VerticalAlignment value specifying vertical alignment.

Remarks

Default value is Top.

Examples

Visual Basic
Dim bitmap As New Aurigma.GraphicsMill.Bitmap( _
 Aurigma.GraphicsMill.RgbColor.White, 200, 60, _
 Aurigma.GraphicsMill.PixelFormat.Format24bppRgb)

Dim graphics As Aurigma.GraphicsMill.Drawing.GdiGraphics = bitmap.GetGdiGraphics

Dim pen As New Aurigma.GraphicsMill.Drawing.Pen(Aurigma.GraphicsMill.RgbColor.Red, 1)

graphics.DrawLine(pen, 0, 30, 200, 30)

Dim brush As New Aurigma.GraphicsMill.Drawing.SolidBrush(Aurigma.GraphicsMill.RgbColor.Black)

' Adjust font settings
Dim font As New Aurigma.GraphicsMill.Drawing.Font("Arial", 20, False, False)
font.HorizontalAlignment = Aurigma.GraphicsMill.Drawing.HorizontalAlignment.Left

'Draw text with different vertical alignments            
font.VerticalAlignment = Aurigma.GraphicsMill.Drawing.VerticalAlignment.Bottom
graphics.DrawString("Bottom", font, brush, 0, 30)

font.VerticalAlignment = Aurigma.GraphicsMill.Drawing.VerticalAlignment.Baseline
graphics.DrawString("Baseline", font, brush, 80, 30)

font.VerticalAlignment = Aurigma.GraphicsMill.Drawing.VerticalAlignment.Top
graphics.DrawString("Top", font, brush, 160, 30)
C#
Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap(
    Aurigma.GraphicsMill.RgbColor.White, 200, 60, 
    Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);

Aurigma.GraphicsMill.Drawing.GdiGraphics graphics = bitmap.GetGdiGraphics();

Aurigma.GraphicsMill.Drawing.Pen pen = 
    new Aurigma.GraphicsMill.Drawing.Pen(Aurigma.GraphicsMill.RgbColor.Red, 1);

graphics.DrawLine(pen, 0, 30, 200, 30);

Aurigma.GraphicsMill.Drawing.SolidBrush brush = 
    new Aurigma.GraphicsMill.Drawing.SolidBrush(Aurigma.GraphicsMill.RgbColor.Black);

//Adjust font settings
Aurigma.GraphicsMill.Drawing.Font font = 
    new Aurigma.GraphicsMill.Drawing.Font("Arial", 20, false, false);
font.HorizontalAlignment = Aurigma.GraphicsMill.Drawing.HorizontalAlignment.Left;

//Draw text with different vertical alignments            
font.VerticalAlignment = Aurigma.GraphicsMill.Drawing.VerticalAlignment.Bottom;
graphics.DrawString("Bottom", font, brush, 0, 30);

font.VerticalAlignment = Aurigma.GraphicsMill.Drawing.VerticalAlignment.Baseline;
graphics.DrawString("Baseline", font, brush, 80, 30);

font.VerticalAlignment = Aurigma.GraphicsMill.Drawing.VerticalAlignment.Top;
graphics.DrawString("Top", font, brush, 160, 30);

See Also

Reference