Table of Contents

Constructor AnimatedImage

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

AnimatedImage(string, bool)

Initializes a new instance of the AnimatedImage class using the specified image source URL and an option to delay loading of animation frames.

public AnimatedImage(string sourceUrl, bool delayLoading = true)

Parameters

sourceUrl string

The URL of the image to be used for the animated image. Must be a valid URL pointing to an image resource.

delayLoading bool

A value indicating whether to delay loading the animation frames. If set to false, frames are loaded immediately upon initialization; otherwise, loading is deferred. Default is true.

Remarks

If delayLoading is set to false, all animation frames are loaded during construction, which may impact performance for large images or slow network connections.

AnimatedImage(Func<Stream>, bool)

Initializes a new instance of the AnimatedImage class using the specified stream provider and an option to delay frame loading.

public AnimatedImage(Func<Stream> streamProvider, bool delayLoading = true)

Parameters

streamProvider Func<Stream>

A function that returns a stream containing the image data to be used for loading the animated image. This parameter cannot be null.

delayLoading bool

A value indicating whether to delay loading of image frames until they are needed. If set to false, all frames are loaded immediately upon initialization.

Remarks

If delayLoading is set to false, all frames are loaded during construction, which may impact performance for large images.

AnimatedImage(Stream)

Initializes a new instance of the AnimatedImage class using the specified stream containing image data.

public AnimatedImage(Stream stream)

Parameters

stream Stream

The stream that provides the image data. The stream must be readable and positioned at the beginning of the image data.

Remarks

The constructor requires that the provided stream contains valid image frames. If the stream does not meet these requirements, an exception may be thrown during initialization.