User-217808514 posted
Hi,
I can't quite believe that this hasn't been encountered and handled hundreds of times before, but it seems not. There we go. The problem is very simple. If you do this:
Dim resizedImage As System.Drawing.Bitmap
Dim Width, Height As Integer
resizedImage = New System.Drawing.Bitmap(Width,Height)
canvas = System.Drawing.Graphics.FromImage(resizedImage)
canvas.DrawImage(imgToResize, 0, 0, calculatedSize.Width, calculatedSize.Height)
And "imgToResize" is an animated GIF, you loose the animation. I've tried a variety of methods to try and resize the image including using Image.GetThumbnailImage and some of the classes in System.Graphics but the result is always the same: the image saves
but it looses it's animation.
Doing some research on the internet I discovered that you can set a System.Drawing.Imaging.EncoderValue.MultiFrame Encoding Parameter - but it only seems to work for animated TIFF files. So that's not a lot of help.
I also discovered the System.Drawing.ImageAnimator class which was new to me, but again this seems to be made to render animated images rather than to help resize them, so I can't see how it's helpful.
Can anyone tell me how I can resize an animated GIF and retain it's animation?
Cheers,
Matt