Issue while saving image using savefiledialog

扶醉桌前 提交于 2019-12-02 04:26:28

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!