Ejemplo n.º 1
0
 private void menuItem20_Click(object sender, System.EventArgs e)
 {
     try
     {
         Stream iStream = UIToolset.LoadImage(openFileDialog1);
         this.setVariables.filter = new Bitmap(Image.FromStream(iStream));
         iStream.Close();
     }
     catch
     {}
 }
Ejemplo n.º 2
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);
     }
 }
Ejemplo n.º 3
0
 public static Stream LoadImage(string file)
 {
     try
     {
         return(new FileStream(file, FileMode.Open));
     }
     catch (IOException ex)
     {
         UIToolset.ShowError(ex);
         return(Stream.Null);
     }
 }
Ejemplo n.º 4
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);
     }
 }
Ejemplo n.º 5
0
 public static Stream LoadImage(OpenFileDialog openFileDialog)
 {
     try
     {
         DialogResult dResult = openFileDialog.ShowDialog();
         return(openFileDialog.OpenFile());
     }
     catch (IOException ex)
     {
         UIToolset.ShowError(ex);
         return(Stream.Null);
     }
 }
Ejemplo n.º 6
0
 private void menuItem5_Click(object sender, System.EventArgs e)
 {
     try
     {
         Stream iStream = UIToolset.LoadImage(openFileDialog1);
         vars.FileName = openFileDialog1.FileName;
         origIm.Image  = Image.FromStream(iStream);
         iStream.Close();
         rIm.Image = origIm.Image;
     }
     catch
     {}
 }
Ejemplo n.º 7
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);
     }
 }
Ejemplo n.º 8
0
        private void menuItem16_Click(object sender, System.EventArgs e)
        {
            ImageSequence sequence = UIToolset.LoadSequence(openFileDialog1);
            String        file     = sequence.NextFile;
            TransformData trData   = new TransformData();

            while (File.Exists(file))
            {
                Stream iStream = UIToolset.LoadImage(file);
                origIm.Image = Image.FromStream(iStream);
                iStream.Close();
                rIm.Image = Insomart.Insom.Transform(origIm.Image, new TransformAction(Insom.ApplyTransform), trData);
                UIToolset.SaveImage(new FileStream(sequence.CurrentCovertedFile, FileMode.Create), rIm.Image);
                file = sequence.NextFile;
            }
        }
Ejemplo n.º 9
0
 private void menuItem9_Click(object sender, System.EventArgs e)
 {
     UIToolset.SaveImage(saveFileDialog1, rIm.Image);
 }
Ejemplo n.º 10
0
 private void menuItem6_Click(object sender, System.EventArgs e)
 {
     UIToolset.SaveImage(new FileStream(vars.FileName, FileMode.Create), rIm.Image);
 }
Ejemplo n.º 11
0
 private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
 {
     origIm.Image = Image.FromStream(UIToolset.LoadImage(openFileDialog1));
     rIm.Image    = origIm.Image;
 }