Beispiel #1
0
 private void processImageAlgo(object algo_type)
 {
     Task.Factory.StartNew(() =>
     {
         //TODO: can race condition with itself...
         if (algo_type is IMAGE_ALGO_TYPES)
         {
             var path = this.imagePath;
             CloseImage();
             var source          = new FileImageSource();
             var image           = source.OpenImage(path);
             var processed_image = imageService.ProcessPixels(image, (IMAGE_ALGO_TYPES)algo_type);
             image.bitmap.Dispose();
             processed_image.bitmap.Save(path);
             OpenImagePath(path);
             //if (service != null)
             //{
             //    var path = this.imagePath;
             //    CloseImage();
             //    var source = new FileImageSource();
             //    var image = source.OpenImage(path);
             //    var processed_image = service.ProcessImage(image);
             //    var temp = new Bitmap(processed_image.bitmap);
             //    //CHO_ACTIVE: OH GOD NO
             //    image.bitmap.Dispose();
             //    processed_image.bitmap.Save(path);
             //    OpenImagePath(path);
             //}
         }
     });
 }