public void Open(Stream stream) { using (BinaryReader br = new BinaryReader(stream)) { iconDirectory.Populate(br); iconImages = new ICONIMAGE[iconDirectory.EntryCount]; // Loop through and read in each image for (int i = 0; i < iconImages.Length; i++) { // Seek to the location in the file that has the image // SetFilePointer( hFile, pIconDir->idEntries[i].dwImageOffset, NULL, FILE_BEGIN ); br.BaseStream.Seek(iconDirectory.Entries[i].ImageOffset, SeekOrigin.Begin); // Read the image data // ReadFile( hFile, pIconImage, pIconDir->idEntries[i].dwBytesInRes, &dwBytesRead, NULL ); // Here, pIconImage is an ICONIMAGE structure. Party on it :) iconImages[i] = new ICONIMAGE(); iconImages[i].Populate(br); } } }
public void Open(Stream stream) { using (BinaryReader br = new BinaryReader(stream)) { iconDirectory.Populate(br); iconImages = new ICONIMAGE[iconDirectory.EntryCount]; // Loop through and read in each image for(int i=0; i < iconImages.Length; i++) { // Seek to the location in the file that has the image // SetFilePointer( hFile, pIconDir->idEntries[i].dwImageOffset, NULL, FILE_BEGIN ); br.BaseStream.Seek(iconDirectory.Entries[i].ImageOffset, SeekOrigin.Begin); // Read the image data // ReadFile( hFile, pIconImage, pIconDir->idEntries[i].dwBytesInRes, &dwBytesRead, NULL ); // Here, pIconImage is an ICONIMAGE structure. Party on it :) iconImages[i] = new ICONIMAGE(); iconImages[i].Populate(br); } } }