From 672c812c70ac0e30fa4ff45ce52e61cd00b96cc2 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Wed, 16 Feb 2022 22:18:28 +0100 Subject: [PATCH] Add repeat count to the gif animation sample --- articles/imagesharp/animatedgif.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/articles/imagesharp/animatedgif.md b/articles/imagesharp/animatedgif.md index a8f9c41d..d2df78d6 100644 --- a/articles/imagesharp/animatedgif.md +++ b/articles/imagesharp/animatedgif.md @@ -19,6 +19,10 @@ Color[] colors = { // Create empty image. using Image gif = new(width, height, Color.Blue); + +// Set animation loop repeat count to 5. +var gifMetaData = gif.Metadata.GetGifMetadata(); +gifMetaData.RepeatCount = 5; for (int i = 0; i < colors.Length; i++) { // Create a color image, which will be added to the gif.