Table of Contents

Class VideoEffectScrollingTextLogo

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

Renders horizontally scrolling text overlays on video frames, ideal for news tickers, credits, or continuous message displays.

public class VideoEffectScrollingTextLogo : VideoEffect, IVideoEffectScrollingTextLogo, IVideoEffect, IDisposable

Inheritance

Implements

Inherited Members

Remarks

SDK Availability:

  • VideoCaptureCore SDK - Windows only
  • MediaPlayerCore SDK - Windows only
  • VideoEditCore SDK - Windows only

Platform Support: Windows only (requires GDI+ for text rendering and animation)

Effect Behavior:

The VideoEffectScrollingTextLogo effect creates smooth horizontal scrolling text that moves from right to left across the video frame. Unlike VisioForge.Core.Types.VideoEffects.VideoEffectTextLogo, this effect is specifically designed for continuous horizontal text animation, commonly used for news tickers, credit rolls, emergency alerts, or advertising messages. The text automatically wraps and can be configured to loop infinitely or play once.

Key Features:

  • Smooth Scrolling Animation: Configurable scroll speed for pixel-perfect horizontal movement
  • Infinite Looping: Text can restart automatically when it completes scrolling off screen
  • Font Customization: Full control over font family, size, style, and color
  • Positioning: Vertical positioning with horizontal scroll
  • Quality Control: Antialiasing and interpolation settings for smooth, high-quality rendering
  • Transparency Support: Alpha blending for semi-transparent scrolling text
  • Performance Optimized: Frame caching and efficient rendering for real-time playback
  • Event Notifications: Callback support via VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.TextRestarted delegate when text completes a cycle
  • Preloading Support: VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Preload(System.Int32,System.Int32,System.Int32) method to prepare text rendering before playback starts

Use Cases:

  • News ticker displays on broadcast or streaming video
  • End credits for video productions
  • Emergency alert messages or important announcements
  • Stock ticker or financial information displays
  • Advertising banners on video content
  • Social media handles or website information
  • Live event information scrolling during broadcasts

Technical Details:

The effect uses an internal frame cache (VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.FrameCache, VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.DrawCache, VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.DataCache) to optimize rendering performance. Text is pre-rendered to bitmap buffers and then scrolled pixel-by-pixel across the video frame. The scroll speed is controlled by the VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Speed property, which determines how many pixels the text moves per frame.

When the text reaches the left edge and scrolls off screen, the effect can either stop or restart from the right edge based on the VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Infinite property. The VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.FirstFrameNumber property tracks the starting frame for synchronization purposes, and can be reset using the VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Reset method.

For optimal performance in scenarios where immediate display is critical (e.g., live broadcasts), use the VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Preload(System.Int32,System.Int32,System.Int32) method before starting video playback. This pre-generates the text rendering buffers and eliminates any delay on the first frame.

The effect supports dynamic text updates during playback. Modify the VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Text property and call VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Update to change the scrolling message. The text will smoothly transition to the new content on the next rendering cycle.

Constructors

VideoEffectScrollingTextLogo(bool, string, TimeSpan, TimeSpan)

Initializes a new instance of the VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo class with default settings.

public VideoEffectScrollingTextLogo(bool enabled, string name = "ScrollingTextLogo", TimeSpan startTime = default, TimeSpan stopTime = default)

Parameters

enabled bool

true to enable the scrolling effect immediately; false to create the effect in a disabled state. The effect can be enabled later by setting VisioForge.Core.Types.VideoEffects.VideoEffect.Enabled to true.

name string

A unique name for this effect instance. This name can be used to retrieve the effect interface for dynamic control during playback. Default is "ScrollingTextLogo".

startTime TimeSpan

The playback position at which scrolling should begin. Use Zero (default) to start scrolling from the beginning of the video. The effect will not be visible before this time even if enabled is true.

stopTime TimeSpan

The playback position at which scrolling should stop. Use Zero (default) to continue scrolling until the end of the video. When set to a specific time, the effect will automatically hide after that playback position is reached.

Remarks

The constructor initializes the effect with sensible defaults optimized for news ticker displays:

  • Font: Arial 36pt
  • Position: (0, 0) top-left corner for full-width scrolling
  • Speed: 5 pixels per frame (moderate scrolling speed)
  • Font color: White
  • Background: Transparent
  • Text: Sample excerpt (from "The Hobbit" for demonstration)
  • Infinite looping: Enabled
  • Draw quality: High quality bicubic interpolation
  • Antialiasing: ClearTypeGridFit for smooth LCD display
All properties can be modified after construction. Call VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Update after making changes to apply them. For best performance in time-critical scenarios, use VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Preload(System.Int32,System.Int32,System.Int32) before starting video playback.

Properties

Antialiasing

Gets or sets the text antialiasing mode for smooth text rendering.

public TextRenderingHint Antialiasing { get; set; }

Property Value

TextRenderingHint

Remarks

Antialiasing is crucial for scrolling text to prevent flickering and jagged edges during motion. Recommended settings:

BackgroundColor

Gets or sets the background color behind the scrolling text.

public Color BackgroundColor { get; set; }

Property Value

Color

Remarks

This color is only visible when VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.BackgroundTransparent is set to false. The background creates a horizontal strip across the video frame at the specified VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Top position. Common uses include:

  • Semi-transparent dark backgrounds (e.g., Color.FromArgb(180, 0, 0, 0)) for improved text readability
  • Solid brand colors for professional news ticker appearance
  • Contrasting colors to ensure text visibility over any video content

BackgroundTransparent

Gets or sets a value indicating whether the text background should be transparent.

public bool BackgroundTransparent { get; set; }

Property Value

bool

Remarks

When set to true, only the text itself is visible, allowing the underlying video to show through behind the scrolling text. When set to false, a rectangular background strip is drawn using VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.BackgroundColor, creating a solid banner behind the text. Opaque backgrounds can improve readability over busy or contrasting video content.

Bitmap

Gets or sets bitmap buffer.

public nint Bitmap { get; set; }

Property Value

nint

BitmapHeight

Gets or sets bitmap height.

public int BitmapHeight { get; set; }

Property Value

int

BitmapWidth

Gets or sets bitmap width.

public int BitmapWidth { get; set; }

Property Value

int

DrawQuality

Gets or sets the interpolation mode used for graphics rendering quality.

public InterpolationMode DrawQuality { get; set; }

Property Value

InterpolationMode

Remarks

The interpolation mode affects rendering quality during the scrolling animation. HighQualityBicubic provides the smoothest scrolling appearance but uses more CPU. For performance-critical scenarios or lower-end hardware, consider Bilinear or NearestNeighbor.

FirstFrameNumber

Gets or sets the frame number at which scrolling should start or restart.

public long FirstFrameNumber { get; set; }

Property Value

long

Remarks

This property is used internally to synchronize scrolling with video frames.

  • -1 (default): Scrolling starts on the first frame the effect is active
  • Specific value: Scrolling starts/restarts at that frame number
Use the VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Reset method to reset this to -1, which will restart scrolling from the beginning on the next frame. This is primarily for internal frame synchronization and typically doesn't need to be set manually.

Font

Gets or sets the font used for rendering the scrolling text.

public Font Font { get; set; }

Property Value

Font

Remarks

The font determines the appearance and readability of the scrolling text. For scrolling displays:

  • Use clear, legible fonts like Arial, Helvetica, or Verdana
  • Bold styles improve readability at small sizes or over video
  • Size should be proportional to video resolution and viewing distance
  • Avoid overly decorative fonts that are hard to read while scrolling
The font object is cloned when set to ensure the internal state remains consistent.

FontColor

Gets or sets the color of the scrolling text.

public Color FontColor { get; set; }

Property Value

Color

Remarks

Choose a color that provides good contrast with the video content and optional background. Common choices include:

  • White text for dark or varied backgrounds
  • Black or dark text for light backgrounds
  • Brand colors for corporate or thematic content
  • High-contrast colors (yellow, cyan) for emergency alerts
The color supports full ARGB values including alpha transparency.

Infinite

Gets or sets a value indicating whether the scrolling text should restart automatically when it completes scrolling off screen.

public bool Infinite { get; set; }

Property Value

bool

Remarks

When set to true, the text will continuously scroll in an endless loop throughout the video duration. This is ideal for news tickers, stock tickers, or continuous information displays.

When set to false, the text scrolls across the screen once and then stops (becomes invisible). This is suitable for one-time announcements or credits.

When the text completes a cycle and restarts, the VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.TextRestarted delegate is invoked (if set), allowing you to update the text content or perform other actions.

Left

Gets or sets the X coordinate (horizontal position) for the scrolling text area.

public int Left { get; set; }

Property Value

int

Remarks

This defines the left edge of the scrolling text area. Text scrolls within this region. For most use cases, keep this at 0 to allow scrolling across the full video width. Non-zero values can be used to confine scrolling to a specific horizontal region of the frame.

NeedUpdate

Gets or sets a value indicating whether data update required.

public bool NeedUpdate { get; set; }

Property Value

bool

Speed

Gets or sets the horizontal scroll speed in pixels per frame.

public int Speed { get; set; }

Property Value

int

Remarks

This property controls how fast the text scrolls from right to left across the video frame.

  • Lower values (1-5): Slow, smooth scrolling suitable for detailed reading
  • Medium values (6-15): Standard scrolling speed for news tickers and general use
  • Higher values (16-50): Fast scrolling for urgent messages or when space is limited
The actual visual speed also depends on the video frame rate. At 30fps, a speed of 5 pixels/frame equals 150 pixels/second. For smooth scrolling, choose a speed that balances readability with the amount of content to display.

StringFormat

Gets or sets the string formatting options for text layout.

public StringFormat StringFormat { get; set; }

Property Value

StringFormat

Remarks

For scrolling text, the StringFormat primarily affects vertical alignment within the text height and character spacing. Most scrolling text scenarios work well with default formatting, but this property allows fine-tuning of text rendering.

Text

Gets or sets the text content that will scroll across the video frame.

public string Text { get; set; }

Property Value

string

Remarks

The text scrolls continuously from right to left across the video frame. For best results:

  • Keep text length appropriate for the scroll speed and viewing duration
  • Use spaces or separators between logical segments for readability
  • Consider repeating key information if using infinite looping
  • For news tickers, separate items with " | " or similar delimiters
Text can be updated dynamically during playback by modifying this property and calling VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Update. The new text will begin scrolling on the next rendering cycle.

TextRestarted

Gets or sets the delegate that is invoked when the scrolling text completes a cycle and restarts.

public Delegate TextRestarted { get; set; }

Property Value

Delegate

Remarks

This property allows you to receive notifications when the scrolling text completes scrolling off the left edge and restarts from the right edge (when VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Infinite is true).

Use this callback to:

  • Update the VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Text property with new content
  • Log or track the number of scroll cycles
  • Synchronize with other events in your application
  • Implement content rotation for news tickers

The delegate is called from the video processing thread, so ensure any UI updates are marshaled to the appropriate thread.

Top

Gets or sets the Y coordinate (vertical position) of the scrolling text.

public int Top { get; set; }

Property Value

int

Remarks

This controls the vertical placement of the horizontal scrolling text. Common positions include:

  • 0 or small value: Top ticker for news or alerts
  • Middle of frame: Central messaging or advertising
  • Near bottom: Credits or subtitles
The text maintains this vertical position throughout the scrolling animation.

TransparencyLevel

Gets or sets the transparency level (alpha channel value) of the entire scrolling text overlay.

public int TransparencyLevel { get; set; }

Property Value

int

Remarks

This transparency level is applied to the entire scrolling text overlay including text and background. A value of 0 (default) means no additional transparency is applied beyond what's specified in colors. Values greater than 0 progressively make the overlay more transparent:

  • 0-50: Nearly opaque, minimal transparency
  • 51-150: Subtle transparency, allows some video to show through
  • 151-254: Highly transparent, ghosted appearance
  • 255: Completely invisible
Useful for creating subtle overlays that don't dominate the video content.

Methods

Dispose(bool)

Dispose.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

The disposing.

Dispose()

This code added to correctly implement the disposable pattern.

public void Dispose()

~VideoEffectScrollingTextLogo()

Finalizes an instance of the VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo class.

protected ~VideoEffectScrollingTextLogo()

GetEffectType()

Gets the effect type identifier for this video effect.

public VideoEffectType GetEffectType()

Returns

VideoEffectType

VisioForge.Core.Types.VideoEffects.VideoEffectType.ScrollingTextLogo identifying this as a scrolling text overlay effect.

Remarks

This method is used internally by the SDK to identify and process different types of video effects.

Preload(int, int, int)

Pre-generates the scrolling text rendering buffers before video playback begins.

public void Preload(int frameWidth, int frameHeight, int frameStride)

Parameters

frameWidth int

The width of the video frame in pixels.

frameHeight int

The height of the video frame in pixels.

frameStride int

The stride (bytes per row) of the video frame buffer.

Remarks

This method preloads the scrolling text overlay by pre-rendering the text buffers before video playback starts. This is particularly useful in scenarios where you need immediate, delay-free display of scrolling text on the very first frame, such as live broadcasts or real-time video streaming.

When to use preloading:

  • Live video capture or streaming where first-frame latency is critical
  • Time-sensitive displays like news tickers or emergency alerts
  • Production environments where smooth, immediate display is required
  • When you know the video dimensions before playback starts

Performance considerations:

Preloading generates the text rendering cache and bitmap buffers ahead of time, eliminating the initialization delay that would otherwise occur on the first video frame. This results in smoother playback start and immediate text visibility.

Call this method after configuring all text properties (font, text content, colors, etc.) but before starting video playback. The frame dimensions must match your actual video resolution for correct rendering.

If frame dimensions are zero or invalid, the method returns immediately without preloading.

Reset()

Resets the scrolling animation to start from the beginning on the next frame.

public void Reset()

Remarks

This method resets the VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.FirstFrameNumber to -1, which causes the scrolling text to restart from the right edge of the screen on the next rendered frame.

Use this method when you want to restart the scrolling animation, for example:

  • After seeking to a different position in the video
  • When switching to new text content that should start from the beginning
  • To synchronize scrolling with specific events in your application

Note: This method does not clear the internal cache or force an immediate re-render. The text will begin scrolling from the right edge on the next frame processing cycle.

Update()

Signals that effect properties have been modified and the scrolling overlay should be re-rendered.

public void Update()

Remarks

Call this method after modifying any visual properties of the effect (text, colors, position, font, speed, etc.) to trigger a re-render of the scrolling text overlay. This is necessary for dynamic updates during playback.

The method sets an internal flag that causes the effect to regenerate its internal rendering buffers on the next video frame. This is thread-safe and can be called from any thread.

Common scenarios requiring VisioForge.Core.Types.VideoEffects.VideoEffectScrollingTextLogo.Update:

  • Changing the scrolling text content
  • Modifying scroll speed during playback
  • Updating colors or transparency
  • Changing font properties

See Also