Table of Contents

Class AnimDecoder

Namespace
Imazen.WebP
Assembly
Imazen.WebP.dll

Decodes animated WebP images into individual frames. Uses libwebpdemux's WebPAnimDecoder internally.

public class AnimDecoder : IDisposable
Inheritance
AnimDecoder
Implements
Inherited Members

Constructors

AnimDecoder(byte[], bool)

Creates an animation decoder from WebP data.

public AnimDecoder(byte[] webpData, bool useThreads = false)

Parameters

webpData byte[]

Complete animated WebP file data.

useThreads bool

Use multi-threaded decoding.

AnimDecoder(Stream, bool)

Creates an animation decoder from a stream.

public AnimDecoder(Stream stream, bool useThreads = false)

Parameters

stream Stream
useThreads bool

Properties

Info

Gets information about the animation (dimensions, frame count, loop count).

public AnimInfo Info { get; }

Property Value

AnimInfo

Methods

DecodeAllFrames()

Decodes all frames and returns them as a list. Each frame's Pixels array contains BGRA data for the full canvas.

public List<AnimFrame> DecodeAllFrames()

Returns

List<AnimFrame>

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetNextFrame()

Gets the next decoded frame, or null if no more frames. The returned pixel data is BGRA for the full canvas.

public AnimFrame? GetNextFrame()

Returns

AnimFrame

HasMoreFrames()

Checks if there are more frames to decode.

public bool HasMoreFrames()

Returns

bool

Reset()

Resets the decoder to the first frame.

public void Reset()