views:

14

answers:

1

Hi

Here is my code

     SaveFileDialog dialog = new SaveFileDialog();
      if (dialog.ShowDialog() == DialogResult.OK)
      {
         aspectRatioPictureBox1.Photo.Save(dialog.FileName,
          System.Drawing.Imaging.ImageFormat.Bmp);
      }
      dialog.Dispose();

I want to save the file in mypictures folder defaultly with the name given by user

+1  A: 

Why use SaveFileDialog ? Prompt the user to provide file-name to save and save the file to MyPictures special folder with that file-name.

Environment.SpecialFolder special = Environment.SpecialFolder.MyPictures;
string MyPicturesLocation = Environment.GetFolderPath(special);

//prompt the user for file-name and save it to MyPicturesLocation here.
this. __curious_geek