From c54d55f5cc2657a44a32f37d2c07c53e2e833d7d Mon Sep 17 00:00:00 2001 From: Caden-Fletcher <110023835+Caden-Fletcher@users.noreply.github.com> Date: Wed, 24 May 2023 14:56:39 -0500 Subject: [PATCH 1/3] Updated some documentation. --- docs/CombiningImages.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/CombiningImages.md b/docs/CombiningImages.md index 580df9859f..3af587eebc 100644 --- a/docs/CombiningImages.md +++ b/docs/CombiningImages.md @@ -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[0].GifDisposeMethod = GifDisposeMethod.Previous; images[1].Flip(); // Optionally reduce colors From b32400c258d654f36770568944c015974cc102c8 Mon Sep 17 00:00:00 2001 From: Caden-Fletcher <110023835+Caden-Fletcher@users.noreply.github.com> Date: Wed, 24 May 2023 15:26:28 -0500 Subject: [PATCH 2/3] Updated some documentation. --- docs/CombiningImages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CombiningImages.md b/docs/CombiningImages.md index 3af587eebc..90d6503a73 100644 --- a/docs/CombiningImages.md +++ b/docs/CombiningImages.md @@ -33,7 +33,7 @@ images[0].GifDisposeMethod = GifDisposeMethod.Previous; // Prevents frames with // 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[0].GifDisposeMethod = GifDisposeMethod.Previous; +images[1].GifDisposeMethod = GifDisposeMethod.Previous; images[1].Flip(); // Optionally reduce colors From 330ceeab8819c9d1a7b66b53c0e951a01f935c5c Mon Sep 17 00:00:00 2001 From: Caden-Fletcher <110023835+Caden-Fletcher@users.noreply.github.com> Date: Thu, 25 May 2023 17:04:16 -0500 Subject: [PATCH 3/3] Updated the CreateAnimatedGif() code sample. --- samples/Magick.NET.Samples/CombiningImages.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/Magick.NET.Samples/CombiningImages.cs b/samples/Magick.NET.Samples/CombiningImages.cs index 69cfbb8af5..b2e678949c 100644 --- a/samples/Magick.NET.Samples/CombiningImages.cs +++ b/samples/Magick.NET.Samples/CombiningImages.cs @@ -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