【发布时间】:2011-11-16 13:34:57
【问题描述】:
我尝试通过标准 Windows.Forms 实现它的方式(以获取有效的 DialogResult.OK)
System.Windows.Forms.SaveFileDialog dlg = new System.Windows.Forms.SaveFileDialog();
dlg.FileName = "Document"; // Default file name
// dlg.DefaultExt = ".jpg"; // Default file extension
dlg.Filter = "JPeg Image|*.jpg|Bitmap Image|*.bmp|Gif Image|*.gif";
if(dlg.ShowDialog()== System.Windows.Forms.DialogResult.OK)
if (dlg.DialogResult.HasValue && splashDialog.DialogResult.Value)
{
string fName = dlg.FileName;
if (dlg.FileName != "")
{
System.IO.Stream fileStream = (System.IO.FileStream)dlg.OpenFile();
fileStream.Close();
}
}
这是使用 Windows 窗体,但它保存空白图像((
【问题讨论】:
-
你只是打开和关闭文件,你从来没有在其中写入图像......
标签: c# wpf savefiledialog