Table of Contents

Class ImageSource

Namespace
VAST.Image
Assembly
VAST.Image.dll

Provides a media source implementation for static images using SkiaSharp. Supports loading images from streams or SKBitmap objects and rendering text overlays.

public class ImageSource : IImageSource, IMediaSource, IReferenceable, IDisposable
Inheritance
ImageSource
Implements
Inherited Members

Constructors

ImageSource(bool, bool)

Initializes a new instance of the ImageSource class.

public ImageSource(bool useAbsoluteTimestamps = false, bool loop = true)

Parameters

useAbsoluteTimestamps bool

Whether to use absolute NTP timestamps for output samples.

loop bool

Whether to loop playback continuously.

Exceptions

UnauthorizedAccessException

Thrown when the license is invalid.

Methods

SetImage(SKBitmap, bool)

Sets the image from an SKBitmap object.

public void SetImage(SKBitmap image, bool disposeImage = false)

Parameters

image SKBitmap

The SKBitmap image to use as the source.

disposeImage bool

Whether to dispose the bitmap after copying its data.

SetImage(Stream, bool)

Sets the image from a stream containing encoded image data.

public override void SetImage(Stream imageStream, bool leaveOpen = false)

Parameters

imageStream Stream

The stream containing the encoded image data.

leaveOpen bool

Whether to leave the stream open after reading.

SetImageAsync(SKBitmap, bool)

Asynchronously sets the image from an SKBitmap object.

public Task SetImageAsync(SKBitmap image, bool disposeImage = false)

Parameters

image SKBitmap

The SKBitmap image to use as the source.

disposeImage bool

Whether to dispose the bitmap after copying its data.

Returns

Task

A task representing the asynchronous operation.

SetImageAsync(Stream, bool)

Asynchronously sets the image from a stream containing encoded image data.

public override Task SetImageAsync(Stream imageStream, bool leaveOpen = false)

Parameters

imageStream Stream

The stream containing the encoded image data.

leaveOpen bool

Whether to leave the stream open after reading.

Returns

Task

A task representing the asynchronous operation.

SetText(OverlayText)

Renders text as an image based on the specified overlay text configuration. Supports font styling, colors, alignment, and outline rendering.

public override void SetText(OverlayText content)

Parameters

content OverlayText

The overlay text configuration containing text, font, and positioning settings.

SetTextAsync(OverlayText)

Asynchronously renders text as an image based on the specified overlay text configuration.

public override Task SetTextAsync(OverlayText content)

Parameters

content OverlayText

The overlay text configuration containing text, font, and positioning settings.

Returns

Task

A task representing the asynchronous operation.