Class OverlayManagerPan
- Namespace
- VisioForge.Core.Types.X.VideoEffects
- Assembly
- VisioForge.Core.dll
Pan effect for overlay manager that animates the visible area between a start rectangle and a stop rectangle over time. This creates a smooth panning and zooming effect commonly used in Ken Burns-style video presentations. Implements the VisioForge.Core.Types.X.VideoEffects.IOverlayManagerElement interface.
public class OverlayManagerPan : IOverlayManagerElementInheritance
Implements
Inherited Members
Constructors
OverlayManagerPan()
Initializes a new instance of the VisioForge.Core.Types.X.VideoEffects.OverlayManagerPan class with default values.
public OverlayManagerPan()OverlayManagerPan(int, int, int, int, int, int, int, int, TimeSpan, TimeSpan, bool, string)
Initializes a new instance of the VisioForge.Core.Types.X.VideoEffects.OverlayManagerPan class with specified start and stop rectangles.
public OverlayManagerPan(int startX, int startY, int startWidth, int startHeight, int stopX, int stopY, int stopWidth, int stopHeight, TimeSpan startTime, TimeSpan endTime, bool enabled = true, string name = "Pan")Parameters
startXint-
The start rectangle X position.
startYint-
The start rectangle Y position.
startWidthint-
The start rectangle width.
startHeightint-
The start rectangle height.
stopXint-
The stop rectangle X position.
stopYint-
The stop rectangle Y position.
stopWidthint-
The stop rectangle width.
stopHeightint-
The stop rectangle height.
startTimeTimeSpan-
The animation start time.
endTimeTimeSpan-
The animation end time.
enabledbool-
If set to
true, the effect is enabled. namestring-
The effect name.
Properties
Cache
Gets or sets the cache object used internally for rendering.
public object Cache { get; set; }Property Value
Easing
Gets or sets the easing function for the pan animation.
public OverlayManagerPanEasing Easing { get; set; }Property Value
Enabled
Gets or sets a value indicating whether this VisioForge.Core.Types.X.VideoEffects.OverlayManagerPan is enabled.
public bool Enabled { get; set; }Property Value
EndTime
Gets or sets the end time when the pan animation ends. This is REQUIRED for pan effects to determine animation progress.
public TimeSpan EndTime { get; set; }Property Value
InterpolationMode
Gets or sets the interpolation mode used when scaling the video during pan.
public OverlayManagerInterpolationMode InterpolationMode { get; set; }Property Value
Name
Gets or sets the name of the element.
public string Name { get; set; }Property Value
Opacity
Gets or sets the opacity (0.0 to 1.0). Note: Opacity is not directly applicable for pan effects.
public double Opacity { get; set; }Property Value
Rotation
Gets or sets the rotation angle in degrees (0-360). Note: Rotation is applied after pan transformation.
public double Rotation { get; set; }Property Value
Shadow
Gets or sets the shadow settings. Note: Shadow is not applicable for pan effects and will be ignored.
public OverlayManagerShadowSettings Shadow { get; set; }Property Value
StartHeight
Gets or sets the height of the start rectangle. Use 0 or -1 for full video height.
public int StartHeight { get; set; }Property Value
StartTime
Gets or sets the start time when the pan animation begins. This is REQUIRED for pan effects to determine animation progress.
public TimeSpan StartTime { get; set; }Property Value
StartWidth
Gets or sets the width of the start rectangle. Use 0 or -1 for full video width.
public int StartWidth { get; set; }Property Value
StartX
Gets or sets the X position of the start rectangle (top-left corner).
public int StartX { get; set; }Property Value
StartY
Gets or sets the Y position of the start rectangle (top-left corner).
public int StartY { get; set; }Property Value
StopHeight
Gets or sets the height of the stop rectangle. Use 0 or -1 for full video height.
public int StopHeight { get; set; }Property Value
StopWidth
Gets or sets the width of the stop rectangle. Use 0 or -1 for full video width.
public int StopWidth { get; set; }Property Value
StopX
Gets or sets the X position of the stop rectangle (top-left corner).
public int StopX { get; set; }Property Value
StopY
Gets or sets the Y position of the stop rectangle (top-left corner).
public int StopY { get; set; }Property Value
ZIndex
Gets or sets the Z-Index (drawing order). Higher values are drawn on top. For pan effects, this determines the order of transformation application.
public int ZIndex { get; set; }Property Value
Methods
FromRectangles((int X, int Y, int Width, int Height), (int X, int Y, int Width, int Height), TimeSpan, TimeSpan)
Creates a pan effect from start rectangle to stop rectangle.
public static OverlayManagerPan FromRectangles((int X, int Y, int Width, int Height) startRect, (int X, int Y, int Width, int Height) stopRect, TimeSpan startTime, TimeSpan endTime)Parameters
startRect(int X, int Y, int Width, int Height)-
The start rectangle (X, Y, Width, Height).
stopRect(int X, int Y, int Width, int Height)-
The stop rectangle (X, Y, Width, Height).
startTimeTimeSpan-
The animation start time.
endTimeTimeSpan-
The animation end time.
Returns
- OverlayManagerPan
-
A configured OverlayManagerPan instance.
GetCurrentRectangle(TimeSpan, int, int)
Calculates the current rectangle based on the animation progress.
public (double X, double Y, double Width, double Height) GetCurrentRectangle(TimeSpan currentTime, int videoWidth, int videoHeight)Parameters
currentTimeTimeSpan-
The current playback time.
videoWidthint-
The full video width (for resolving -1 values).
videoHeightint-
The full video height (for resolving -1 values).
Returns
- (double X, double Y, double Width, double Height)
-
The interpolated rectangle (X, Y, Width, Height) for the current time.