/** <summary> Returns a palette image loaded from the specified stream. </summary> */ public static PaletteImage FromStream(Stream stream) { BinaryReader reader = new BinaryReader(stream); ImageDirectory imageDirectory = new ImageDirectory(); GraphicsData graphicsData = new GraphicsData(imageDirectory); imageDirectory.Read(reader); graphicsData.Read(reader); reader.Close(); return(graphicsData.GetPaletteImage(0)); }
//-------------------------------- #endregion //=========== READING ============ #region Reading /** <summary> Reads the object data. </summary> */ protected void Read(BinaryReader reader, bool quickLoad = false) { // Read the header ReadHeader(reader); // Read the string table entries stringTable.Read(reader, NumStringTableEntries); // Read the group info if (HasGroupInfo) { groupInfo.Read(reader); } // Read the optional section ReadOptional(reader); // Read the image directory imageDirectory.Read(reader, quickLoad); // Read the graphics data graphicsData.Read(reader); }