title: C# can't seem to correctly add images to ziparchive
body: <p>I'm trying to add a bunch of files to a zipfile in c# but it doesn't seem to work properly.</p>
  
  <pre><code>using (var memoryStream = new MemoryStream())
  {
      using (var zip = new ZipArchive(memoryStream, ZipArchiveMode.Create, true))
      {
          for (int i = 0; i &lt; kaart_data.GetLength(0); i++)
          {
              Image img = array[i];
  
              var file = zip.CreateEntry(i + ".bmp");
              using (var stream = new MemoryStream())
              {
                  img.Save(stream, ImageFormat.Bmp);
                  using (var entryStream = file.Open())
                  {
                      stream.CopyTo(entryStream);
                  }
              }
          }
      }
  
      //saves the archive to disk
      using (var fileStream = new FileStream(@"C:\Temp\test.zip", FileMode.Create))
      {
          memoryStream.Seek(0, SeekOrigin.Begin);
          memoryStream.CopyTo(fileStream);
      }
  }
  </code></pre>
  
  <p>The thing is it does create and save the zip file into disk with the expected file size.</p>
  
  <p>But when I try to open them in windows photo viewer they seem to be corrupted.</p>
  
  <p>Any help is appreciated.</p>