Here is the code I use to extract GIF frames
EDIT: just so you are aware Image.FrameDimensionsList is an array of Guid's not Images/Bitmaps
class Frame
{
public int Duration;
public Bitmap Image;
public Frame(int duration, Bitmap image)
{
Image = image;
Duration = duration;
}
}
// implementation
Frame[] frames;
FrameDimension fd = new FrameDimension(image.FrameDimensionsList[0]);
int frameCount = image.GetFrameCount(fd);
if (frameCount > 1)
{
frames = new Frame[frameCount];
//0x5100 is the property id of the GIF frame's durations
//this property does not exist when frameCount <= 1
byte[] times = image.GetPropertyItem(0x5100).Value;
for (int i = 0; i < frameCount; i++)
{
//selects GIF frame based on FrameDimension and frameIndex
image.SelectActiveFrame(fd, i);
//length in milliseconds of display duration
int length = BitConverter.ToInt32(times, 4 * i) * 10;
//save currect image frame as new bitmap
frames[i] = new Frame(length, new Bitmap(image));
}
} // Not animated