I\'m using savefiledialog to save an image. Canvas is picturebox and the loaded image is bitmap. When I try to save it the file is created but somehow corrupted. Cause when I tr
I was gonna ask why you have the line
System.IO.FileStream fs =
(System.IO.FileStream)saveFileDialog1.OpenFile();
But as it turns out, that's exactly the line causing your problems. You are opening the file to a FileStream
. While it's open, you use canvas.Image.Save
to write the image to that same file.
It throws an exception, but since you just write the exception to the console you don't see it.
Just remove the line I mentioned and your code will work.