Table of Contents

Class OverlayManagerWPFControl

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

WPF Control overlay element that renders a WPF FrameworkElement as a video overlay. Supports Storyboard animations, data binding, and complex WPF visual trees. Periodically snapshots the WPF element at a configurable refresh rate. Windows-only.

public class OverlayManagerWPFControl : IOverlayManagerElement, IDisposable

Inheritance

Implements

Inherited Members

Constructors

OverlayManagerWPFControl(Func<FrameworkElement>, int, int, int, int, int)

Initializes a new instance of the VisioForge.Core.Types.X.VideoEffects.OverlayManagerWPFControl class. The factory function will be invoked on the internal STA thread to create the WPF element.

public OverlayManagerWPFControl(Func<FrameworkElement> elementFactory, int x, int y, int width, int height, int refreshRate = 15)

Parameters

elementFactory Func<FrameworkElement>

Factory that creates the WPF FrameworkElement.

x int

The X position.

y int

The Y position.

width int

The width.

height int

The height.

refreshRate int

Snapshots per second (1-60).

Properties

Cache

Gets or sets the cached image surface for rendering.

public object Cache { get; set; }

Property Value

object

Dpi

Gets or sets the DPI used for rendering. Default is 96.

public double Dpi { get; set; }

Property Value

double

ElementFactory

Gets or sets the factory function that creates the WPF FrameworkElement on the internal STA thread. This is the recommended way to provide WPF content.

public Func<FrameworkElement> ElementFactory { get; set; }

Property Value

Func<FrameworkElement>

Enabled

Gets or sets whether the overlay is enabled.

public bool Enabled { get; set; }

Property Value

bool

EndTime

Gets or sets the end time for the overlay visibility.

public TimeSpan EndTime { get; set; }

Property Value

TimeSpan

Height

Gets or sets the height of the overlay.

public int Height { get; set; }

Property Value

int

Lock

Gets the lock object for thread synchronization.

public object Lock { get; }

Property Value

object

Name

Gets or sets the name of the element.

public string Name { get; set; }

Property Value

string

Opacity

Gets or sets the opacity of the overlay (0.0 to 1.0).

public double Opacity { get; set; }

Property Value

double

RefreshRate

Gets or sets the refresh rate in frames per second (1-60). Controls how often the WPF element is snapshot for overlay rendering. Default is 15.

public int RefreshRate { get; set; }

Property Value

int

Rotation

Gets or sets the rotation angle in degrees.

public double Rotation { get; set; }

Property Value

double

Shadow

Gets or sets the shadow settings for the overlay.

public OverlayManagerShadowSettings Shadow { get; set; }

Property Value

OverlayManagerShadowSettings

StartTime

Gets or sets the start time for the overlay visibility.

public TimeSpan StartTime { get; set; }

Property Value

TimeSpan

StretchMode

Gets or sets the stretch mode for the rendered control.

public OverlayManagerImageStretchMode StretchMode { get; set; }

Property Value

OverlayManagerImageStretchMode

Width

Gets or sets the width of the overlay.

public int Width { get; set; }

Property Value

int

X

Gets or sets the X position of the overlay.

public int X { get; set; }

Property Value

int

Y

Gets or sets the Y position of the overlay.

public int Y { get; set; }

Property Value

int

ZIndex

Gets or sets the Z-index for layering.

public int ZIndex { get; set; }

Property Value

int

Methods

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Initialize()

Initializes the WPF control overlay and starts periodic rendering.

public bool Initialize()

Returns

bool

true if successful; otherwise, false.

InvokeOnUIThread(Action)

Executes an action on the WPF STA thread. Use this to safely update WPF controls at runtime.

public void InvokeOnUIThread(Action action)

Parameters

action Action

The action to execute.

InvokeOnUIThread<T>(Func<T>)

Executes a function on the WPF STA thread and returns the result. Use this to safely read WPF control properties at runtime.

public T InvokeOnUIThread<T>(Func<T> func)

Parameters

func Func<T>

The function to execute.

Returns

T

The result of the function.

Type Parameters

T

The return type.

See Also