Table of Contents

Enum HorizontalAlignment

Namespace
VisioForge.Core.Types.VideoProcessing
Assembly
VisioForge.Core.dll

Specifies the horizontal alignment of visual elements within video frames during video processing operations.

public enum HorizontalAlignment

Fields

Left = 0

Aligns the element to the left edge of its container.

When applied to text, the left edge of the text is positioned at the specified location. For images and other visual elements, the left edge of the bounding box is used as the alignment point.

This is typically the default alignment for left-to-right languages and is commonly used for: - Subtitle positioning in Western languages - Logo placement in the top-left corner - Status information displays

Right = 1

Aligns the element to the right edge of its container.

When applied to text, the right edge of the text is positioned at the specified location. For images and other visual elements, the right edge of the bounding box is used as the alignment point.

Common uses include: - Watermark placement in corners - Right-to-left language text - Timestamp displays - Channel logos for broadcast applications

Center = 2

Centers the element horizontally within its container.

The element's horizontal center is aligned with the center of its container. This provides equal spacing on both left and right sides.

Centered alignment is commonly used for: - Main titles and headings - Subtitles and closed captions - Notification messages - Loading indicators - Symmetrical logo placement

Examples

// Position a watermark in the top-right corner
var watermarkSettings = new WatermarkSettings
{
    Image = watermarkImage,
    HorizontalAlignment = HorizontalAlignment.Right,
    VerticalAlignment = VerticalAlignment.Top,
    Margin = new Padding(10)
};

// Center a subtitle at the bottom of the frame
var subtitleSettings = new TextOverlaySettings
{
    Text = "Sample Subtitle",
    HorizontalAlignment = HorizontalAlignment.Center,
    VerticalAlignment = VerticalAlignment.Bottom,
    MarginBottom = 50
};

Remarks

The VisioForge.Core.Types.VideoProcessing.HorizontalAlignment enumeration is used throughout the video processing pipeline to control the horizontal positioning of various visual elements such as: - Text overlays and subtitles - Watermarks and logos - Picture-in-picture elements - Graphical overlays and annotations - Motion detection grids and regions

This alignment is relative to the containing element or frame boundaries. The exact behavior depends on the specific video processing component using this enumeration.

When used with text overlays, the alignment point is typically: - Left: The left edge of the text baseline - Center: The horizontal center of the text - Right: The right edge of the text baseline