how loop gif animation ?

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
Posts: 3
Joined: 2017-07-16T12:13:24-07:00
Authentication code: 1151

how loop gif animation ?

Post by rafael105 »

Hello :)

I try to create gif animation and i want the animation will start over when all the frames is end, thats mean the gif animation will run non stop.

How can i do that ?

Here is my sample code:

Code: Select all

public string Get()
            using (MagickImageCollection collection = new MagickImageCollection())
                // Add first image and set the animation delay to 100ms
                collection[0].AnimationDelay = 100;

                // Add second image, set the animation delay to 100ms and flip the image
                collection[1].AnimationDelay = 100;
                // Optionally reduce colors
                QuantizeSettings settings = new QuantizeSettings();
                settings.Colors = 256;
                // Optionally optimize the images (images should have the same size).

                // Save gif
                string data = collection.ToBase64(MagickFormat.Gif);

                return data;
Post Reply