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); } }
public static Stream LoadImage(string file) { try { return(new FileStream(file, FileMode.Open)); } catch (IOException ex) { UIToolset.ShowError(ex); return(Stream.Null); } }
public static ImageSequence LoadSequence(OpenFileDialog openFileDialog) { try { DialogResult dResult = openFileDialog.ShowDialog(); return(new ImageSequence(openFileDialog.FileName)); } catch (IOException ex) { UIToolset.ShowError(ex); return(null); } }
public static Stream LoadImage(OpenFileDialog openFileDialog) { try { DialogResult dResult = openFileDialog.ShowDialog(); return(openFileDialog.OpenFile()); } catch (IOException ex) { UIToolset.ShowError(ex); return(Stream.Null); } }
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); } }