0

I am reading a GIF image and creating the ImageMagick object in C#. Then I write the same image to the output. In the output I get a static image without animation.

               MagickImage image = new MagickImage(ImagePath); 
               Byte[] buffer = image.ToByteArray();                                         
               HttpContext.Current.Response.ContentType = "image/gif";                                 
               HttpContext.Current.Response.OutputStream.Write(buffer, 0, buffer.Length);     
               HttpContext.Current.Response.StatusCode = 200; 
Dave Schweisguth
  • 36,475
  • 10
  • 98
  • 121
Naresh
  • 5,073
  • 12
  • 67
  • 124

1 Answers1

2

A MagickImage is a single image. When you read a .gif file you will only get the first frame of that animation. If you want to preserve the animation you should create a MagickImageCollection instead.

dlemstra
  • 7,813
  • 2
  • 27
  • 43