Пример #1
0
 private void simpleButton4_Click(object sender, EventArgs e)
 {
     RecipeMan.Recipes selection = (RecipeMan.Recipes)Enum.Parse(typeof(RecipeMan.Recipes), (String)recipeCompboBox.EditValue);
     if (MessageBox.Show(String.Format("Will process files in {0} using {1} recipe, writing to {2}",
                                       (String)inputDirectoryEdit.EditValue,
                                       selection.ToString(),
                                       (String)outputDirectoryTextEdit.EditValue), "Confirm", MessageBoxButtons.OKCancel) != System.Windows.Forms.DialogResult.OK)
     {
         return;
     }
     foreach (string file in System.IO.Directory.EnumerateFiles((String)inputDirectoryEdit.EditValue, "*.jpg"))
     {
         Image img    = Image.FromFile(file);
         Image outimg = _recipeMan.runRecipe(selection, img, false);
         outimg.Save(outputDirectoryTextEdit.EditValue + "/" + System.IO.Path.GetFileName(file));
     }
 }
Пример #2
0
 private void oneTimeButton_Click(object sender, EventArgs e)
 {
     RecipeMan.Recipes selection = (RecipeMan.Recipes)Enum.Parse(typeof(RecipeMan.Recipes), (String)recipeCompboBox.EditValue);
     SetModImage(_recipeMan.runRecipe(selection, pictureEdit1.Image, true));
 }