GifCodec

Ecng.Drawing

Fully managed animated GIF decoder/encoder. Supports global/local palettes, LZW, interlace, transparent indices, disposal 0/1/2/3, Netscape loop count, arbitrary image subrectangles, delay and full frame compositing. GIF output has 1-bit alpha and at most 256 colors per frame by format definition.

Methods

Open
public static Animation Open(byte[] data)
result = GifCodec.Open(data)

Reads what the file says about itself and prepares its frames for decoding.

ReadLoopCount
public static int ReadLoopCount(byte[] data)
result = GifCodec.ReadLoopCount(data)

Reads the loop count of the NETSCAPE2.0 extension: how many times the animation is repeated after its first run, 0 for endlessly.

Returns: The loop count, or -1 if the file has no such extension.