Gets or sets a vertical text alignment.
Namespace:
Aurigma.GraphicsMill.Drawing
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
public VerticalAlignment VerticalAlignment { get; set; }
using (var bitmap = new Bitmap(200, 60, PixelFormat.Format24bppRgb, RgbColor.White)) { using (var graphics = bitmap.GetGraphics()) { var pen = new Pen(RgbColor.Red, 1); graphics.DrawLine(pen, 0, 30, 200, 30); var brush = new SolidBrush(RgbColor.Black); //Adjust font settings var font = new Font("Arial", 20, false, false); font.HorizontalAlignment = HorizontalAlignment.Left; //Draw text with different vertical alignments font.VerticalAlignment = VerticalAlignment.Bottom; graphics.DrawString("Bottom", font, brush, 0, 30); font.VerticalAlignment = VerticalAlignment.Baseline; graphics.DrawString("Baseline", font, brush, 80, 30); font.VerticalAlignment = VerticalAlignment.Top; graphics.DrawString("Top", font, brush, 160, 30); bitmap.Save(@"Images\Output\string.png"); } }