Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/CombiningImages.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ result.Write("Mosaic.png");
```C#
using var images = new MagickImageCollection();

// Add first image and set the animation delay to 100ms
// Add the first image, set the animation delay to 100ms, and set the disposal method
images.Add(SampleFiles.SnakewarePng);
images[0].AnimationDelay = 100;
images[0].GifDisposeMethod = GifDisposeMethod.Previous; // Prevents frames with transparent backgrounds from overlapping each other

// Add second image, set the animation delay to 100ms and flip the image
// Add the second image, set the animation delay to 100ms, set the disposal method, and flip the image
images.Add(SampleFiles.SnakewarePng);
images[1].AnimationDelay = 100;
images[1].GifDisposeMethod = GifDisposeMethod.Previous;
images[1].Flip();

// Optionally reduce colors
Expand Down
6 changes: 4 additions & 2 deletions samples/Magick.NET.Samples/CombiningImages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public static void CreateAnimatedGif()
{
using var images = new MagickImageCollection();

// Add first image and set the animation delay to 100ms
// Add the first image, set the animation delay to 100ms, and set the disposal method
images.Add(SampleFiles.SnakewarePng);
images[0].AnimationDelay = 100;
images[0].GifDisposeMethod = GifDisposeMethod.Previous; // Prevents frames with transparent backgrounds from overlapping each other

// Add second image, set the animation delay to 100ms and flip the image
// Add the second image, set the animation delay to 100ms, set the disposal method, and flip the image
images.Add(SampleFiles.SnakewarePng);
images[1].AnimationDelay = 100;
images[1].GifDisposeMethod = GifDisposeMethod.Previous;
images[1].Flip();

// Optionally reduce colors
Expand Down