R
Roger C Garrett in Hawaii
Guest
I'm trying to save a pictureBox image out to a file and sometimes am getting an exception thrown.
If I do this:
pictureBox1.Image.Save("image", System.Drawing.Imaging.ImageFormat.Bmp);
it works just fine.
If I do this:
pictureBox1.Image.Save("C:image", System.Drawing.Imaging.ImageFormat.Bmp);
it also works fine.
But if I try to specify a particular subdirectory, like this:
pictureBox1.Image.Save("C:\Pictures\image", System.Drawing.Imaging.ImageFormat.Bmp);
it fails, throwing a generic exception.
Even if I just put a slash after the C:, like this
pictureBox1.Image.Save("C:\image", System.Drawing.Imaging.ImageFormat.Bmp);
it throws a generic exception.
What am I doing wrong?
Continue reading...
If I do this:
pictureBox1.Image.Save("image", System.Drawing.Imaging.ImageFormat.Bmp);
it works just fine.
If I do this:
pictureBox1.Image.Save("C:image", System.Drawing.Imaging.ImageFormat.Bmp);
it also works fine.
But if I try to specify a particular subdirectory, like this:
pictureBox1.Image.Save("C:\Pictures\image", System.Drawing.Imaging.ImageFormat.Bmp);
it fails, throwing a generic exception.
Even if I just put a slash after the C:, like this
pictureBox1.Image.Save("C:\image", System.Drawing.Imaging.ImageFormat.Bmp);
it throws a generic exception.
What am I doing wrong?
Continue reading...