Table of Contents

Class ImageOverlayBlock

Namespace
VisioForge.Core.MediaBlocks.VideoProcessing
Assembly
VisioForge.Core.dll

MediaBlock that overlays static images onto video streams with positioning, scaling, and transparency control. This block composites image files (PNG, JPEG, BMP, etc.) over video content, supporting features like alpha blending, custom positioning, rotation, scaling, and fade effects. Commonly used for watermarks, logos, brand overlays, lower thirds, and creative graphic elements in video production workflows. The overlay supports real-time updates and animation effects including fade-in and fade-out transitions. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class ImageOverlayBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

ImageOverlayBlock(string)

Initializes a new instance of the VisioForge.Core.MediaBlocks.VideoProcessing.ImageOverlayBlock class with the specified image file. Creates default overlay settings with the image positioned at the top-left corner.

public ImageOverlayBlock(string filename)

Parameters

filename string

The path to the image file to overlay (supports PNG, JPEG, BMP, and other common formats).

ImageOverlayBlock(ImageOverlaySettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.VideoProcessing.ImageOverlayBlock class with custom overlay settings. Allows full control over positioning, scaling, transparency, and other overlay properties.

public ImageOverlayBlock(ImageOverlaySettings settings)

Parameters

settings ImageOverlaySettings

The ImageOverlaySettings instance defining the complete overlay configuration.

Properties

Input

Gets the input.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets the inputs.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the output.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets the outputs.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the image overlay settings that control the overlay behavior including image file path, position, size, transparency, rotation, and blending mode. Call the Update method after modifying settings if the pipeline is already started.

public ImageOverlaySettings Settings { get; set; }

Property Value

ImageOverlaySettings

Type

Gets the type.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Constructs and initializes the image overlay filter and its associated GStreamer elements. This method creates the filter with the specified overlay settings, establishes input and output pads, and prepares the block for image compositing operations.

public override bool Build()

Returns

bool

true if the filter was successfully built and configured; false if initialization failed.

CleanUp()

Releases all resources and performs cleanup operations for this image overlay block. This method disposes of the GStreamer elements and resets the build state.

public void CleanUp()

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

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

GetCore()

Gets the core BaseElement wrapper that provides additional functionality around the GStreamer image overlay filter element.

public BaseElement GetCore()

Returns

BaseElement

The BaseElement wrapper instance that encapsulates the GStreamer image overlay filter.

GetElement()

Gets the underlying GStreamer element that performs the image overlay processing.

public Element GetElement()

Returns

Element

The GStreamer Element instance representing the image overlay filter.

IsAvailable()

Determines whether the image overlay filter is available on the current system. This checks if the required GStreamer video processing plugins are installed and accessible. The correct NuGet SDK redistribution package should be included in your project.

public static bool IsAvailable()

Returns

bool

true if the image overlay filter is available and can be used; otherwise, false.

StartFadeIn(TimeSpan)

Initiates a smooth fade-in transition that gradually increases the overlay opacity from zero to full visibility. This creates a professional appear effect commonly used for introducing graphics or watermarks.

public void StartFadeIn(TimeSpan duration)

Parameters

duration TimeSpan

The duration of the fade-in transition. Must be a positive TimeSpan value.

StartFadeOut(TimeSpan)

Initiates a smooth fade-out transition that gradually reduces the overlay opacity to zero. This creates a professional dissolve effect commonly used in broadcast and video production.

public void StartFadeOut(TimeSpan duration)

Parameters

duration TimeSpan

The duration of the fade-out transition. Must be a positive TimeSpan value.

Update()

Updates the overlay settings in real-time while the pipeline is running. Call this method after modifying the Settings property to apply changes immediately. This allows dynamic repositioning, scaling, or changing overlay properties during playback.

public void Update()

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Associates this image overlay block with a pipeline and initializes its internal context. This method is called internally when the block is added to a pipeline.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The MediaBlocksPipeline instance that will manage this block.

See Also