public bool Open(Stream fs) { StartOffset = fs.Position; Header = MarshalUtil.ReadStruct <ICNHeader>(fs); //read header fs.Seek(StartOffset + 0x2000, SeekOrigin.Begin); //Jump to the icons DataHeader = MarshalUtil.ReadStruct <ICNDataHeader>(fs); //read data header //fs.Seek(0x40, SeekOrigin.Current); //skip header SmallIcon = ImageUtil.ReadImageFromStream(fs, 24, 24, ImageUtil.PixelFormat.RGB565); LargeIcon = ImageUtil.ReadImageFromStream(fs, 48, 48, ImageUtil.PixelFormat.RGB565); return(true); }
public bool Open(Stream fs) { StartOffset = fs.Position; Header = MarshalUtil.ReadStruct<ICNHeader>(fs); //read header fs.Seek(StartOffset + 0x2000, SeekOrigin.Begin); //Jump to the icons DataHeader = MarshalUtil.ReadStruct<ICNDataHeader>(fs); //read data header //fs.Seek(0x40, SeekOrigin.Current); //skip header SmallIcon = ImageUtil.ReadImageFromStream(fs, 24, 24, ImageUtil.PixelFormat.RGB565); LargeIcon = ImageUtil.ReadImageFromStream(fs, 48, 48, ImageUtil.PixelFormat.RGB565); return true; }