GifWriter Class

Contains methods and properties used to write GIF images (both static and animated).

Namespace: Aurigma.GraphicsMill.Codecs
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public sealed class GifWriter : ImageWriter

Remarks

GIF (Graphics Interchange Format) is a bitmap image format which works well for saving any type of grayscale or 256 color image. The color limitation makes the GIF format unsuitable for reproducing color photographs and other images with continuous color, but it is well-suited for simpler images such as graphics or logos with solid areas of color. The GIF image format supports animations and one-dimensional interlacing (a method of progressive displaying). GIF interlacing makes this format convenient for transmission of images across slow communication links.

GIF format can store only indexed images. As soon as it supports animation, it can contain multiple frames. Frame can have its own position, and a number of other paramaters, as delay time, disposal method, etc.

Examples

The following code creates an animated GIF file by grouping JPEG images:

C#
string dir = @"C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\\";
string[] images = { "Chrysanthemum.jpg", "Desert.jpg", "Jellyfish.jpg", "Tulips.jpg" };

using (var writer = new GifWriter(@"Images\Output\Slideshow.gif"))
using (var cc = new ColorConverter(PixelFormat.Format8bppIndexed))
{
    writer.FrameOptions.Delay = 100;

    foreach (string image in images)
    {
        using (var reader = new JpegReader(dir + image))
        {
            Pipeline.Run(reader + cc + writer);
        }
    }
}

Inheritance Hierarchy

System.Object

Thread Safety

Static members of this type are not safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.

See Also

Reference

Manual