예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;

            Saveprompt   sp     = new Saveprompt("Save the image");
            DialogResult prompt = sp.ShowDialog();

            if (prompt == DialogResult.OK)
            {
                string path     = sp.path;
                string filename = sp.filename;
                string full     = String.Format("{0}\\{1}.jpg", path, filename);


                pictureBox1.Image.Save(@full, ImageFormat.Jpeg);
                DialogResult result = MessageBox.Show("Image Saved. Would you like to open it?", "Operation Completed", MessageBoxButtons.YesNo, MessageBoxIcon.None);
                if (result == DialogResult.Yes)
                {
                    System.Diagnostics.Process.Start(@full);
                }
                statusLbl.Text = "Image saved Successfully!!";
            }
            else
            {
                MessageBox.Show("Operation Cancelled", "Operation Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                statusLbl.Text = "Image not saved!";
            }

            timer1.Enabled = true;
        }
예제 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;

            Saveprompt sp = new Saveprompt("Save the image");
            DialogResult prompt = sp.ShowDialog();
            if (prompt == DialogResult.OK)
            {
                string path = sp.path;
                string filename = sp.filename;
                string full = String.Format("{0}\\{1}.jpg", path, filename);

                pictureBox1.Image.Save(@full, ImageFormat.Jpeg);
                DialogResult result = MessageBox.Show("Image Saved. Would you like to open it?", "Operation Completed", MessageBoxButtons.YesNo, MessageBoxIcon.None);
                if (result == DialogResult.Yes)
                {
                    System.Diagnostics.Process.Start(@full);
                }
                statusLbl.Text = "Image saved Successfully!!";
            }
            else
            {
                MessageBox.Show("Operation Cancelled", "Operation Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                statusLbl.Text = "Image not saved!";
            }

            timer1.Enabled = true;
        }