Table of Contents

Class AnimFrame

Namespace
Imazen.WebP
Assembly
Imazen.WebP.dll

Represents a single frame in an animated WebP image.

public class AnimFrame
Inheritance
AnimFrame
Inherited Members

Constructors

AnimFrame(byte[], int, int, int)

Creates a new animation frame with the given pixel data and timestamp.

public AnimFrame(byte[] pixels, int width, int height, int timestampMs)

Parameters

pixels byte[]

Decoded BGRA pixel data for the full canvas.

width int

Canvas width in pixels.

height int

Canvas height in pixels.

timestampMs int

Frame timestamp in milliseconds.

Properties

DurationMs

Duration of this frame in milliseconds (computed from next frame's timestamp). -1 if unknown (last frame).

public int DurationMs { get; }

Property Value

int

Height

Canvas height in pixels.

public int Height { get; }

Property Value

int

Pixels

The decoded pixel data for this frame (BGRA by default). This is a full-canvas composite — alpha-blended with previous frames.

public byte[] Pixels { get; }

Property Value

byte[]

TimestampMs

Timestamp in milliseconds for when this frame should be displayed.

public int TimestampMs { get; }

Property Value

int

Width

Canvas width in pixels.

public int Width { get; }

Property Value

int