How do you split an animated gif into its component parts in .net?
Specifically i want to load them into Image(s) (System.Drawing.Image) in memory.
======================
Based on SLaks' answer i now have this
public static IEnumerable<Bitmap> GetImages(Stream stream)
{
using (var gifImage = Image.FromStream(stream))
{
var dimension = new FrameDimension(gifImage.FrameDimensionsList[0]); //gets the GUID
var frameCount = gifImage.GetFrameCount(dimension); //total frames in the animation
for (var index = 0; index < frameCount; index++)
{
gifImage.SelectActiveFrame(dimension, index); //find the frame
yield return (Bitmap) gifImage.Clone(); //return a copy of it
}
}
}