private void button9_Click(object sender, EventArgs e)
        {
            savefile.Filter = "Images|*.png;*.bmp;*.jpg";
            ImageFormat format = ImageFormat.Png;

            if (savefile.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string ext = System.IO.Path.GetExtension(savefile.FileName);
                switch (ext)
                {
                case ".jpg":
                    format = ImageFormat.Jpeg;
                    break;

                case ".bmp":
                    format = ImageFormat.Bmp;
                    break;
                }
                Output_Picture.Image.Save(savefile.FileName, format);

                SuccessfulMessage success = new SuccessfulMessage();
                success.label1.Text = "Image saved successfully!";
                if (success.ShowDialog() == DialogResult.OK)
                {
                    label5.Focus();
                }
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            ImageInputError();
            if (Image_Validation.Equals(true))
            {
                savefile.Filter = "Images|*.png;*.bmp;*.jpg";
                ImageFormat format = ImageFormat.Png;
                if (savefile.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    string ext = System.IO.Path.GetExtension(savefile.FileName);
                    switch (ext)
                    {
                    case ".jpg":
                        format = ImageFormat.Jpeg;
                        break;

                    case ".bmp":
                        format = ImageFormat.Bmp;
                        break;
                    }
                    Main_Picture.Image.Save(savefile.FileName, format);

                    SuccessfulMessage success = new SuccessfulMessage();
                    success.label1.Text = "Image saved successfully!";
                    if (success.ShowDialog() == DialogResult.OK)
                    {
                        Status_lbl.Text = "Image Saved";
                    }
                }
            }
        }
 private void ImageInputError()
 {
     if (FilePath_lbl.Text.Equals("*browse image*"))
     {
         SuccessfulMessage success = new SuccessfulMessage();
         success.MessageBar.Text = "Error Message.";
         success.label1.Text     = "Must browse an image!";
         success.panel3.Size     = new Size(115, 3);
         if (success.ShowDialog() == DialogResult.OK)
         {
             success.Close();
         }
     }
     else
     {
         Image_Validation = true;
     }
 }
        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Start();
            progressBar1.Increment(5);
            if (progressBar1.Value == 100)
            {
                timer1.Stop();
                SuccessfulMessage success = new SuccessfulMessage();

                this.Close();
                if (success.ShowDialog() == DialogResult.OK)
                {
                    Output Output_form = new Output();
                    Output_form.Show();
                    for (int i = Application.OpenForms.Count - 1; i >= 0; i--)
                    {
                        if (Application.OpenForms[i].Name != "Output")
                        {
                            Application.OpenForms[i].Hide();
                        }
                    }
                }
            }
        }