首页 新闻 会员 周边

saveFileDialog怎么用,没成功呢

0
悬赏园豆:10 [已解决问题] 解决于 2012-09-15 18:38

private void 保存SToolStripButton_Click(object sender, EventArgs e) { SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.Filter = "JPeg Image|*.jpg|Bitmap Image|*.bmp|Gif Image|*.gif"; string localFilePath = saveFileDialog1.FileName.ToString();//获取路径 saveFileDialog1.ShowDialog(); if (saveFileDialog1.ShowDialog() == DialogResult.OK) { MapExport export = new MapExport(this.mapControl1.Map.Clone() as Map);// export.ExportSize = new ExportSize(this.mapControl1.Map.Size.Width, // 尺寸 当前屏幕 this.mapControl1.Map.Size.Height); export.Format = ExportFormat.Gif;// 格式 gif export.Export(@"localFilePath\ExportImage.gif"); } } 如果不用saveFileDialog,直接用下面的程序是能成功的 MapExport export = new MapExport(this.mapControl1.Map.Clone() as Map); export.ExportSize = new ExportSize(this.mapControl1.Map.Size.Width, this.mapControl1.Map.Size.Height); export.Format = ExportFormat.Gif; export.Export(@"D\ExportImage.gif"); 没有多少分,还请各位高手帮帮忙

C#
雪藩的主页 雪藩 | 初学一级 | 园豆:126
提问于:2012-09-13 11:25
< >
分享
最佳答案
0

export.Export(@"localFilePath\ExportImage.gif");改为export.Export(saveFileDialog1.FileName

雪藩 | 初学一级 |园豆:126 | 2012-09-15 18:37
其他回答(1)
0

string localFilePath = saveFileDialog1.FileName.ToString()放在

if (saveFileDialog1.ShowDialog() == DialogResult.OK) { 里面

export.Export(localFilePath+"\ExportImage.gif");

 

收获园豆:10
向往-SONG | 园豆:4853 (老鸟四级) | 2012-09-13 11:33
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册