Class SVGOverlayVideoEffect
- Namespace
- VisioForge.Core.Types.X.VideoEffects
- Assembly
- VisioForge.Core.dll
Represents an SVG overlay effect that renders scalable vector graphics on top of video content.
public class SVGOverlayVideoEffect : BaseVideoEffect, IBaseVideoEffectInheritance
Implements
Inherited Members
Remarks
SDK Availability: VideoCaptureCoreX, MediaPlayerCoreX, VideoEditCoreX, Media Blocks SDK
Platforms: Windows, Linux, macOS, Android, iOS
This effect renders Scalable Vector Graphics (SVG) content as an overlay on video, providing crisp, resolution-independent graphics that scale without quality loss. SVG overlays are perfect for logos, icons, diagrams, and animated graphics that need to maintain quality at any size.
The SVG overlay effect supports:
- File-Based SVG: Load SVG graphics from external files
- Inline SVG Data: Embed SVG markup directly in code
- Absolute Sizing: Specify overlay dimensions in pixels
- Relative Sizing: Size overlay as percentage of video dimensions
- Absolute Positioning: Position overlay using pixel coordinates
- Relative Positioning: Position overlay as percentage of video dimensions
- Fit-to-Frame: Automatically scale SVG to fill entire video frame
- Transparency: Full alpha channel support from SVG content
The SVG overlay effect is commonly used for:
- Branding: Company logos and watermarks with perfect clarity
- Lower Thirds: Name plates and title graphics for broadcasts
- Diagrams: Technical illustrations and infographics
- Icons: Status indicators and UI elements
- Animated Graphics: SVG animations with SMIL or CSS
- Multi-Resolution: Content that needs to look sharp at any resolution
SVG graphics provide several advantages over raster images:
- Scale to any size without quality loss
- Small file sizes compared to high-resolution raster images
- Can include animations and interactivity
- Easy to edit and modify in vector graphics editors
- Precise control over colors, gradients, and effects
Position and size can be specified using either absolute pixel values or relative percentages. Relative sizing is recommended for responsive layouts that adapt to different video resolutions. Use VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.FitToFrame to automatically scale the SVG to fill the entire video frame, useful for full-frame graphics and backgrounds.
This is a cross-platform effect using the rsvgoverlay element. The effect leverages
the librsvg library for SVG rendering.
Performance: Real-time capable for most SVG graphics. Complex SVGs with many paths, gradients, or filters may impact performance. Static SVGs are cached after initial rendering. Animated SVGs require per-frame rendering. Consider SVG complexity for real-time applications.
SVG Feature Support: Supports SVG 1.1 specification. Advanced features like filters, gradients, patterns, and animations are supported. JavaScript in SVG is not executed for security reasons. External references in SVG (xlink:href) may have platform-specific behavior.
Constructors
SVGOverlayVideoEffect(string, string)
Initializes a new instance of the VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect class.
public SVGOverlayVideoEffect(string filename, string name = "svg-overlay")Parameters
filenamestring-
The path to the SVG file to render as an overlay.
namestring-
The unique name for this effect instance. Defaults to "svg-overlay".
Fields
DefaultName
The default name for SVG overlay effects.
public static string DefaultNameField Value
Properties
Data
Gets or sets the inline SVG data as a string.
public string Data { get; set; }Property Value
Remarks
Use this property to embed SVG content directly in code instead of loading from a file. This is useful for simple graphics, dynamically generated SVG, or when you want to avoid external file dependencies. The string should contain valid SVG XML markup starting with an <svg> root element.
Filename
Gets or sets the path to the SVG file.
public string Filename { get; set; }Property Value
Remarks
Specifies the location of the SVG file to render. The file should contain valid SVG 1.1 content. If VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.Data is also specified, the inline data takes precedence. Ensure the file path is accessible and the file exists before applying the effect.
FitToFrame
Gets or sets a value indicating whether to fit the SVG to fill the entire video frame.
public bool FitToFrame { get; set; }Property Value
Remarks
When enabled, the SVG is automatically scaled to cover the entire video frame while maintaining its aspect ratio. This is useful for full-frame backgrounds, watermarks, or decorative elements. Position properties are ignored when fit-to-frame is enabled.
Height
Gets or sets the height of the SVG overlay in pixels.
public int Height { get; set; }Property Value
Remarks
Specifies the absolute height of the rendered SVG in pixels. If both VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.Width and VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.Height are 0, the SVG's natural dimensions are used. If only one dimension is specified, the aspect ratio is maintained. Use VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.HeightRelative for resolution-independent sizing.
HeightRelative
Gets or sets the height relative to the video frame height (0.0-1.0).
public float HeightRelative { get; set; }Property Value
Remarks
Specifies the height as a percentage of the video frame height, making the overlay scale proportionally with different video resolutions. A value of 0.5 means 50% of the frame height. When specified, this takes precedence over VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.Height. Useful for responsive overlays that adapt to various video sizes.
Width
Gets or sets the width of the SVG overlay in pixels.
public int Width { get; set; }Property Value
Remarks
Specifies the absolute width of the rendered SVG in pixels. If both VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.Width and VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.Height are 0, the SVG's natural dimensions are used. If only one dimension is specified, the aspect ratio is maintained. Use VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.WidthRelative for resolution-independent sizing.
WidthRelative
Gets or sets the width relative to the video frame width (0.0-1.0).
public float WidthRelative { get; set; }Property Value
Remarks
Specifies the width as a percentage of the video frame width, making the overlay scale proportionally with different video resolutions. A value of 0.25 means 25% of the frame width. When specified, this takes precedence over VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.Width. Ideal for responsive layouts across different video sizes.
X
Gets or sets the horizontal position of the SVG overlay in pixels from the left edge.
public int X { get; set; }Property Value
Remarks
Specifies the absolute horizontal position in pixels. Positive values move the overlay right; negative values move it left (potentially off-screen). Use VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.XRelative for resolution-independent positioning.
XRelative
Gets or sets the horizontal position relative to the video frame width (0.0-1.0).
public float XRelative { get; set; }Property Value
Remarks
Specifies the horizontal position as a percentage of the video frame width. A value of 0.5 centers the overlay horizontally. When specified, this takes precedence over VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.X. Enables resolution-independent positioning that adapts to different video sizes.
Y
Gets or sets the vertical position of the SVG overlay in pixels from the top edge.
public int Y { get; set; }Property Value
Remarks
Specifies the absolute vertical position in pixels. Positive values move the overlay down; negative values move it up (potentially off-screen). Use VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.YRelative for resolution-independent positioning. Note: "offsetruh nnn" appears to be a typo in the original.
YRelative
Gets or sets the vertical position relative to the video frame height (0.0-1.0).
public float YRelative { get; set; }Property Value
Remarks
Specifies the vertical position as a percentage of the video frame height. A value of 0.5 centers the overlay vertically. When specified, this takes precedence over VisioForge.Core.Types.X.VideoEffects.SVGOverlayVideoEffect.Y. Provides resolution-independent positioning for responsive overlays.