Table of Contents

Class OverlayManagerSqueezeback

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

Squeezeback effect element that scales the video to a custom rectangle and draws an image overlay on top with alpha transparency support. The typical use case is a full-frame PNG image with transparent areas where the scaled video shows through. Implements the VisioForge.Core.Types.X.VideoEffects.IOverlayManagerElement interface.

public class OverlayManagerSqueezeback : IOverlayManagerElement

Inheritance

Implements

Inherited Members

Constructors

OverlayManagerSqueezeback()

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

public OverlayManagerSqueezeback()

OverlayManagerSqueezeback(string, Rect, Rect)

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

public OverlayManagerSqueezeback(string backgroundImageFilename, Rect videoRect, Rect backgroundRect = null)

Parameters

backgroundImageFilename string

The background image filename.

videoRect Rect

The video rectangle.

backgroundRect Rect

The background rectangle (null for full frame).

Properties

BackgroundAnimationEasing

Gets or sets the background animation easing function.

public OverlayManagerPanEasing BackgroundAnimationEasing { get; set; }

Property Value

OverlayManagerPanEasing

BackgroundAnimationEnabled

Gets or sets whether background animation is enabled.

public bool BackgroundAnimationEnabled { get; set; }

Property Value

bool

BackgroundAnimationEndTime

Gets or sets the background animation end time.

public TimeSpan BackgroundAnimationEndTime { get; set; }

Property Value

TimeSpan

BackgroundAnimationStartRect

Gets or sets the background animation start rectangle.

public Rect BackgroundAnimationStartRect { get; set; }

Property Value

Rect

BackgroundAnimationStartTime

Gets or sets the background animation start time.

public TimeSpan BackgroundAnimationStartTime { get; set; }

Property Value

TimeSpan

BackgroundAnimationTargetRect

Gets or sets the background animation target rectangle.

public Rect BackgroundAnimationTargetRect { get; set; }

Property Value

Rect

BackgroundFadeEasing

Gets or sets the background fade easing.

public OverlayManagerPanEasing BackgroundFadeEasing { get; set; }

Property Value

OverlayManagerPanEasing

BackgroundFadeEnabled

Gets or sets whether background fade is enabled.

public bool BackgroundFadeEnabled { get; set; }

Property Value

bool

BackgroundFadeEndTime

Gets or sets the background fade end time.

public TimeSpan BackgroundFadeEndTime { get; set; }

Property Value

TimeSpan

BackgroundFadeStartTime

Gets or sets the background fade start time.

public TimeSpan BackgroundFadeStartTime { get; set; }

Property Value

TimeSpan

BackgroundFadeType

Gets or sets the background fade type.

public OverlayManagerFadeType BackgroundFadeType { get; set; }

Property Value

OverlayManagerFadeType

BackgroundImageFilename

Gets or sets the overlay image filename (PNG with alpha recommended).

public string BackgroundImageFilename { get; set; }

Property Value

string

BackgroundOpacity

Gets or sets the background opacity (0.0 to 1.0).

public double BackgroundOpacity { get; set; }

Property Value

double

BackgroundRect

Gets or sets the overlay image rectangle (position and size). Null means fill the entire frame.

public Rect BackgroundRect { get; set; }

Property Value

Rect

Cache

Gets or sets the cache object used internally for rendering.

public object Cache { get; set; }

Property Value

object

Enabled

Gets or sets whether the element is enabled.

public bool Enabled { get; set; }

Property Value

bool

EndTime

Gets or sets the end time when the effect stops being visible.

public TimeSpan EndTime { get; set; }

Property Value

TimeSpan

Name

Gets or sets the name of the element.

public string Name { get; set; }

Property Value

string

Opacity

Gets or sets the opacity (0.0 to 1.0). Note: Use VideoOpacity and BackgroundOpacity for individual layer opacity.

public double Opacity { get; set; }

Property Value

double

Rotation

Gets or sets the rotation angle in degrees. Note: Rotation is not applicable for squeezeback effects.

public double Rotation { get; set; }

Property Value

double

Shadow

Gets or sets the shadow settings. Note: Shadow is not applicable for squeezeback effects.

public OverlayManagerShadowSettings Shadow { get; set; }

Property Value

OverlayManagerShadowSettings

StartTime

Gets or sets the start time when the effect becomes visible.

public TimeSpan StartTime { get; set; }

Property Value

TimeSpan

VideoAnimationEasing

Gets or sets the video animation easing function.

public OverlayManagerPanEasing VideoAnimationEasing { get; set; }

Property Value

OverlayManagerPanEasing

VideoAnimationEnabled

Gets or sets whether video animation is enabled.

public bool VideoAnimationEnabled { get; set; }

Property Value

bool

VideoAnimationEndTime

Gets or sets the video animation end time.

public TimeSpan VideoAnimationEndTime { get; set; }

Property Value

TimeSpan

VideoAnimationStartRect

Gets or sets the video animation start rectangle.

public Rect VideoAnimationStartRect { get; set; }

Property Value

Rect

VideoAnimationStartTime

Gets or sets the video animation start time.

public TimeSpan VideoAnimationStartTime { get; set; }

Property Value

TimeSpan

VideoAnimationTargetRect

Gets or sets the video animation target rectangle.

public Rect VideoAnimationTargetRect { get; set; }

Property Value

Rect

VideoFadeEasing

Gets or sets the video fade easing.

public OverlayManagerPanEasing VideoFadeEasing { get; set; }

Property Value

OverlayManagerPanEasing

VideoFadeEnabled

Gets or sets whether video fade is enabled.

public bool VideoFadeEnabled { get; set; }

Property Value

bool

VideoFadeEndTime

Gets or sets the video fade end time.

public TimeSpan VideoFadeEndTime { get; set; }

Property Value

TimeSpan

VideoFadeStartTime

Gets or sets the video fade start time.

public TimeSpan VideoFadeStartTime { get; set; }

Property Value

TimeSpan

VideoFadeType

Gets or sets the video fade type.

public OverlayManagerFadeType VideoFadeType { get; set; }

Property Value

OverlayManagerFadeType

VideoOnTop

Gets or sets whether the video is drawn on top of the image. Default is false: video is drawn first (below), then image is drawn on top with alpha transparency. Set to true to draw the image first, then video on top.

public bool VideoOnTop { get; set; }

Property Value

bool

VideoOpacity

Gets or sets the video opacity (0.0 to 1.0).

public double VideoOpacity { get; set; }

Property Value

double

VideoRect

Gets or sets the video rectangle (position and size where video is scaled).

public Rect VideoRect { get; set; }

Property Value

Rect

ZIndex

Gets or sets the Z-index (should be very low to render first).

public int ZIndex { get; set; }

Property Value

int

Methods

AnimateBackground(Rect, TimeSpan, TimeSpan, OverlayManagerPanEasing)

Starts an animation for the background rectangle.

public void AnimateBackground(Rect targetRect, TimeSpan startTime, TimeSpan duration, OverlayManagerPanEasing easing = OverlayManagerPanEasing.Linear)

Parameters

targetRect Rect

The target rectangle.

startTime TimeSpan

The animation start time.

duration TimeSpan

The animation duration.

easing OverlayManagerPanEasing

The easing function.

AnimateVideo(Rect, TimeSpan, TimeSpan, OverlayManagerPanEasing)

Starts an animation for the video rectangle.

public void AnimateVideo(Rect targetRect, TimeSpan startTime, TimeSpan duration, OverlayManagerPanEasing easing = OverlayManagerPanEasing.Linear)

Parameters

targetRect Rect

The target rectangle.

startTime TimeSpan

The animation start time.

duration TimeSpan

The animation duration.

easing OverlayManagerPanEasing

The easing function.

GetCurrentBackgroundOpacity(double)

Gets the current background opacity based on fade animation progress.

public double GetCurrentBackgroundOpacity(double currentTime)

Parameters

currentTime double

The current playback time.

Returns

double

The current background opacity.

GetCurrentBackgroundRect(double, int, int)

Gets the current background rectangle based on animation progress.

public Rect GetCurrentBackgroundRect(double currentTime, int frameWidth, int frameHeight)

Parameters

currentTime double

The current playback time.

frameWidth int

The frame width (used if BackgroundRect is null).

frameHeight int

The frame height (used if BackgroundRect is null).

Returns

Rect

The current background rectangle.

GetCurrentVideoOpacity(double)

Gets the current video opacity based on fade animation progress.

public double GetCurrentVideoOpacity(double currentTime)

Parameters

currentTime double

The current playback time.

Returns

double

The current video opacity.

GetCurrentVideoRect(double)

Gets the current video rectangle based on animation progress.

public Rect GetCurrentVideoRect(double currentTime)

Parameters

currentTime double

The current playback time.

Returns

Rect

The current video rectangle.

SetBackgroundOnTop()

Sets the background image to be on top.

public void SetBackgroundOnTop()

SetVideoOnTop()

Sets the video to be on top.

public void SetVideoOnTop()

StartBackgroundFadeIn(TimeSpan, TimeSpan, OverlayManagerPanEasing)

Starts a fade-in animation for the background.

public void StartBackgroundFadeIn(TimeSpan startTime, TimeSpan duration, OverlayManagerPanEasing easing = OverlayManagerPanEasing.Linear)

Parameters

startTime TimeSpan

The fade start time.

duration TimeSpan

The fade duration.

easing OverlayManagerPanEasing

The easing function.

StartBackgroundFadeOut(TimeSpan, TimeSpan, OverlayManagerPanEasing)

Starts a fade-out animation for the background.

public void StartBackgroundFadeOut(TimeSpan startTime, TimeSpan duration, OverlayManagerPanEasing easing = OverlayManagerPanEasing.Linear)

Parameters

startTime TimeSpan

The fade start time.

duration TimeSpan

The fade duration.

easing OverlayManagerPanEasing

The easing function.

StartVideoFadeIn(TimeSpan, TimeSpan, OverlayManagerPanEasing)

Starts a fade-in animation for the video.

public void StartVideoFadeIn(TimeSpan startTime, TimeSpan duration, OverlayManagerPanEasing easing = OverlayManagerPanEasing.Linear)

Parameters

startTime TimeSpan

The fade start time.

duration TimeSpan

The fade duration.

easing OverlayManagerPanEasing

The easing function.

StartVideoFadeOut(TimeSpan, TimeSpan, OverlayManagerPanEasing)

Starts a fade-out animation for the video.

public void StartVideoFadeOut(TimeSpan startTime, TimeSpan duration, OverlayManagerPanEasing easing = OverlayManagerPanEasing.Linear)

Parameters

startTime TimeSpan

The fade start time.

duration TimeSpan

The fade duration.

easing OverlayManagerPanEasing

The easing function.

SwapLayers()

Swaps the layer order (video on top / background on top).

public void SwapLayers()

UpdateBackgroundImage(string, Rect)

Updates the background image.

public void UpdateBackgroundImage(string filename, Rect rect = null)

Parameters

filename string

The new image filename.

rect Rect

The new image rectangle (null to keep current).

UpdateVideoPosition(Rect)

Updates the video position.

public void UpdateVideoPosition(Rect rect)

Parameters

rect Rect

The new video rectangle.

See Also