public AnimatedHeaderedImage(Stream stream)
{
BinaryReader reader = new BinaryReader(stream);
short width = reader.ReadInt16();
short height = reader.ReadInt16();
reader.ReadByte();
FramesCount = reader.ReadByte();
Frames = new HeaderedImage[FramesCount];
Frames[0] = new HeaderedImage(width, height, reader.ReadBytes(width*height));
for(int i = 1; i < FramesCount; i++)
{
width = reader.ReadInt16();
height = reader.ReadInt16();
reader.ReadByte();
FramesCount = reader.ReadByte();
Frames[i] = new HeaderedImage(width, height, reader.ReadBytes(width*height));
}
}