Table of Contents

Class OverlayManagerText

Namespace
VisioForge.Core.Types.X.VideoEffects
Assembly
VisioForge.Core.dll

Overlay Manager Text element. Implements the VisioForge.Core.Types.X.VideoEffects.IOverlayManagerElement.

public class OverlayManagerText : IOverlayManagerElement

Inheritance

Derived

Implements

Inherited Members

Constructors

OverlayManagerText()

Initializes a new instance of the VisioForge.Core.Types.X.VideoEffects.OverlayManagerText class.

public OverlayManagerText()

OverlayManagerText(string, int, int)

Initializes a new instance of the VisioForge.Core.Types.X.VideoEffects.OverlayManagerText class.

public OverlayManagerText(string text, int x = 100, int y = 100)

Parameters

text string

The text.

x int

The x.

y int

The y.

Properties

Background

Gets or sets the background.

public IOverlayManagerBackground Background { get; set; }

Property Value

IOverlayManagerBackground

Cache

Gets or sets the cache.

public object Cache { get; set; }

Property Value

object

Color

Gets or sets the color.

public SKColor Color { get; set; }

Property Value

SKColor

CustomHeight

Gets or sets the custom height.

public int CustomHeight { get; set; }

Property Value

int

CustomWidth

Gets or sets the custom width.

public int CustomWidth { get; set; }

Property Value

int

Enabled

Gets or sets a value indicating whether this VisioForge.Core.Types.X.VideoEffects.IOverlayManagerElement is enabled.

public bool Enabled { get; set; }

Property Value

bool

EndTime

Gets or sets the end time (optional).

public TimeSpan EndTime { get; set; }

Property Value

TimeSpan

Font

Gets or sets the font.

public FontSettings Font { get; set; }

Property Value

FontSettings

Name

Gets or sets the name.

public string Name { get; set; }

Property Value

string

Opacity

Gets or sets the opacity (0.0 to 1.0).

public double Opacity { get; set; }

Property Value

double

Rotation

Gets or sets the rotation angle in degrees (0-360).

public double Rotation { get; set; }

Property Value

double

Shadow

Gets or sets the shadow settings.

public OverlayManagerShadowSettings Shadow { get; set; }

Property Value

OverlayManagerShadowSettings

StartTime

Gets or sets the start time (optional).

public TimeSpan StartTime { get; set; }

Property Value

TimeSpan

Text

Gets or sets the text.

public string Text { get; set; }

Property Value

string

TextProvider

Gets or sets a callback supplying the text for every frame. When set it takes precedence over VisioForge.Core.Types.X.VideoEffects.OverlayManagerText.Text; returning null falls back to it. The argument is the frame timestamp, counted from the pipeline start.

public Func<TimeSpan, string> TextProvider { get; set; }

Property Value

Func<TimeSpan, string>

Remarks

The callback is invoked once per frame on the GStreamer streaming thread, so it must be fast and must not block. The text layout cache compares the returned string, so returning an unchanged value costs nothing beyond the call itself, and only a changed value pays for a re-measure.

It runs while the overlay list is locked, the same lock Video_Overlay_Add and Video_Overlay_Remove take. Blocking on another thread from here therefore risks a deadlock, not merely a dropped frame: a callback that calls Dispatcher.Invoke to read a UI value deadlocks outright if the UI thread is adding or removing an overlay at that moment. Read a field the UI thread has already written instead.

A callback that throws is logged once and is then not called again - the element falls back to VisioForge.Core.Types.X.VideoEffects.OverlayManagerText.Text. Retrying it every frame would unwind an exception at the frame rate while the overlay lock is held. Assigning to this property re-enables the mechanism, including assigning the very same delegate again.

X

Gets or sets the X position of the top-left corner of the text, in pixels. Zero is the left edge of the frame.

public int X { get; set; }

Property Value

int

Y

Gets or sets the Y position of the top-left corner of the text, in pixels. Zero is the top edge of the frame; the first line is drawn fully visible there.

public int Y { get; set; }

Property Value

int

ZIndex

Gets or sets the Z-Index (drawing order). Higher values are drawn on top.

public int ZIndex { get; set; }

Property Value

int

See Also