Arun Kurmi

Arun Kurmi

  • NA
  • 104
  • 103.3k

SaveFileDialog in C#

Mar 13 2013 1:01 AM
hi friends,How are you?

Today i want to know.....
how to use SaveFileDialog to save an image from windows form Application. I tried below code but there should be something wrong.
(i have an image on form in picturebox)
private void button2_Click(object sender, EventArgs e)
        {
            saveFileDialog1.ShowDialog();
        }

        private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
        {
            string name = saveFileDialog1.FileName;
            File.WriteAllText(name,pictureBox1.Image.ToString());
        }

Answers (2)