コード例 #1
0
        public void Creates_Folder_Resize_And_Save_Image()
        {
            ImageOutputProperties imageOutputProperties = new ImageOutputPropertiesBuilder().
                                                          WithRelativeFolderPath("output").
                                                          WithResolution(new Size(20, 20)).
                                                          WithFormat(ImageFormat.Png);

            ImageProperties imageProperties = new ImageProperties()
            {
                Image    = this.GivenAnImage(),
                FileName = "image",
                ImageOutputProperties = new List <ImageOutputProperties>()
                {
                    imageOutputProperties
                }
            };

            imageOrchestrator.Generate(imageProperties);

            string outputImagePath = string.Concat(Directory.GetCurrentDirectory(), "\\output\\image.png");

            Assert.True(File.Exists(outputImagePath));
        }
コード例 #2
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     try
     {
         foreach (var imageProperties in this.CreateImageProperties())
         {
             imageOrchestrator.Generate(imageProperties);
         }
         if (!this.CheckBoxCustomFormat.IsChecked.GetValueOrDefault())
         {
             Process.Start(this.TextBoxOutput.Text);
         }
         this.ListBoxFiles.Items.Clear();
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Ups..algo ha ocurrido. {ex.Message}");
     }
 }