Exemple #1
0
 public static void SaveImage(Stream stream, System.Drawing.Image im)
 {
     try
     {
         im.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
         stream.Close();
     }
     catch (IOException ex)
     {
         UIToolset.ShowError(ex);
     }
 }
Exemple #2
0
 public static Stream LoadImage(string file)
 {
     try
     {
         return(new FileStream(file, FileMode.Open));
     }
     catch (IOException ex)
     {
         UIToolset.ShowError(ex);
         return(Stream.Null);
     }
 }
Exemple #3
0
 public static ImageSequence LoadSequence(OpenFileDialog openFileDialog)
 {
     try
     {
         DialogResult dResult = openFileDialog.ShowDialog();
         return(new ImageSequence(openFileDialog.FileName));
     }
     catch (IOException ex)
     {
         UIToolset.ShowError(ex);
         return(null);
     }
 }
Exemple #4
0
 public static Stream LoadImage(OpenFileDialog openFileDialog)
 {
     try
     {
         DialogResult dResult = openFileDialog.ShowDialog();
         return(openFileDialog.OpenFile());
     }
     catch (IOException ex)
     {
         UIToolset.ShowError(ex);
         return(Stream.Null);
     }
 }
Exemple #5
0
 public static void SaveImage(SaveFileDialog saveFileDialog, System.Drawing.Image im)
 {
     try
     {
         saveFileDialog.AddExtension = true;
         saveFileDialog.DefaultExt   = "jpg";
         DialogResult dResult = saveFileDialog.ShowDialog();
         Stream       stream  = saveFileDialog.OpenFile();
         im.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
         stream.Close();
     }
     catch (IOException ex)
     {
         UIToolset.ShowError(ex);
     }
 }