private void Read(BinaryReader reader, bool readFromFile) { this.reserved = reader.ReadUInt16(); this.type = (GroupIconType)reader.ReadUInt16(); int imageCount = reader.ReadUInt16(); this.images = new GroupIconDirectoryInfo[imageCount]; for (int i = 0; i < imageCount; ++i) { this.images[i].width = reader.ReadByte(); this.images[i].height = reader.ReadByte(); this.images[i].colors = reader.ReadByte(); this.images[i].reserved = reader.ReadByte(); this.images[i].planes = reader.ReadUInt16(); this.images[i].bitsPerPixel = reader.ReadUInt16(); this.images[i].imageSize = reader.ReadUInt32(); if (readFromFile) { this.images[i].imageOffset = reader.ReadUInt32(); this.images[i].imageIndex = (ushort)(i + 1); } else { this.images[i].imageIndex = reader.ReadUInt16(); } } }
private void Read(BinaryReader reader, bool readFromFile) { this.reserved = reader.ReadUInt16(); this.type = (GroupIconType)reader.ReadUInt16(); int imageCount = reader.ReadUInt16(); this.images = new GroupIconDirectoryInfo[imageCount]; for (int i = 0; i < imageCount; ++i) { this.images[i].width = reader.ReadByte(); this.images[i].height = reader.ReadByte(); this.images[i].colors = reader.ReadByte(); this.images[i].reserved = reader.ReadByte(); this.images[i].planes = reader.ReadUInt16(); this.images[i].bitsPerPixel = reader.ReadUInt16(); this.images[i].imageSize = reader.ReadUInt32(); if (readFromFile) { this.images[i].imageOffset = reader.ReadUInt32(); this.images[i].imageIndex = (ushort)(i + 1); } else { this.images[i].imageIndex = reader.ReadUInt16(); } } }