Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/05/14 08:36:01 (10 years ago)
Author:
ascheibe
Message:

#1696 adapted FLA to changes of #2247

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape/BoxChart/BoxChartCreator.cs

    r8172 r11661  
    44using System.Drawing.Imaging;
    55using System.IO;
     6using System.IO.Compression;
    67using System.Linq;
    78using HeuristicLab.Collections;
     
    1213using HeuristicLab.Parameters;
    1314using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    14 using ICSharpCode.SharpZipLib.Zip;
    1515
    1616namespace HeuristicLab.Analysis.FitnessLandscape.BoxCharts {
     
    155155        filename = string.Format("{0}.zip", filename);
    156156      using (var stream = File.Create(filename)) {
    157         using (var zipStream = new ZipOutputStream(stream)) {
     157        using (var zipArchive = new ZipArchive(stream, ZipArchiveMode.Create)) {
    158158          foreach (var bitmap in bitmaps) {
    159             zipStream.PutNextEntry(new ZipEntry(bitmap.Key) { DateTime = DateTime.Now });
    160             using (var s = new MemoryStream()) {
     159            var entry = zipArchive.CreateEntry(bitmap.Key);
     160            using (var s = entry.Open()) {
    161161              bitmap.Value.Save(s, ImageFormat.Png);
    162               zipStream.Write(s.ToArray(), 0, (int)s.Length);
    163162            }
    164163          }
     
    166165      }
    167166    }
    168 
    169167    #endregion
    170 
    171168  }
    172169}
Note: See TracChangeset for help on using the changeset viewer.