public void ReloadOriginBitmap() { OriginAirBitmap = WindDownloader.GetWind(); OriginEauBitmap = CourantDownloader.GetCourant(); OutputBitmap = (Bitmap)MaskBitmap.Clone(); lune = new Bitmap(Directory.GetCurrentDirectory() + "\\Img\\" + WindDownloader.Mounth.ToString("00") + WindDownloader.Day.ToString("00") + ".png"); }
private void Transform_Button_Click(object sender, RoutedEventArgs e) { //List<String> files = Directory.EnumerateFiles(transformer.OriginDirectory, Transform_StartWith.Text).ToList<String>(); //files.RemoveAt(0); //transformer.Transform(); //Transform_Image.Source = new BitmapImage(new Uri(transformer.OutputURI)); DateTime start = DateTime.Now; int step = int.Parse(Step_Selector.Text.TrimEnd('m', 'i', 'n')) / 15; int duration = Duration_Selector.Text.EndsWith("day") ? 96 : 2880; // en quart d'heure for (int i = 0; i < duration; i += step) { transformer.ReloadOriginBitmap(); transformer.Transform(step); WindDownloader.MoveOn(step); CourantDownloader.MoveOn(step); } Text_BluePoint.Text = transformer.BluePointVitesse; MessageBox.Show((DateTime.Now - start).TotalHours.ToString() + " - " + (DateTime.Now - start).TotalMinutes.ToString() + " - " + (DateTime.Now - start).TotalSeconds.ToString() + " - " + (DateTime.Now - start).TotalMilliseconds.ToString() + " - "); /*Bitmap img = WindDownloader.GetNextWind(); * String[] tab = WindDownloader.GetImgName().Split('/'); * String name = Directory.GetCurrentDirectory() + "\\Output\\" + tab[tab.Count() - 2] + tab.Last(); * img.Save(name); * Transform_Image.Source = new BitmapImage(new Uri(name));*/ }