WPF 图像批量导出
来源:互联网 发布:火星知乎 编辑:程序博客网 时间:2024/05/19 09:17
图像批量导出,一般导出都是会覆盖,要想不被覆盖,需要更新导出的文件名称。
代码如下:
Microsoft.Win32.SaveFileDialog saveFileDialog = new Microsoft.Win32.SaveFileDialog();
saveFileDialog.DefaultExt = "jpg";
saveFileDialog.Filter = "(*.jpg)|*.jpg|所有文件(*.*)|*.*”";
saveFileDialog.RestoreDirectory = true;
saveFileDialog.CreatePrompt = false;
saveFileDialog.ShowDialog();
string strFilePath = saveFileDialog.FileName;
if (!string.IsNullOrEmpty(strFilePath))
{
int k = 0;
for (int j = 0; j < _imageList.SelectedItems.Count; j++)
{
ImageListItem imgItem = (ImageListItem)_imageList.SelectedItem;
if (imgItem == null)
return;
BitmapImage img1 = imgItem.Image as BitmapImage;
if (img1.UriSource == null)
return;
if (k > 0)
{
strFilePath = strFilePath.Replace(".jpg","0"+ k + ".jpg");
}
string sourcefile = img1.UriSource.LocalPath;
if (!File.Exists(strFilePath))
System.IO.File.Copy(sourcefile, strFilePath, true);
k++;
}
}
- WPF 图像批量导出
- 批量导出
- WPF 导出EXCEL 方法
- WPF中导出excel
- Wpf 控件导出Png
- WPF的图像处理
- WPF Image图像裁剪
- WPF显示GIF图像
- 批量导出存储过程
- 批量导出存储过程
- Oracle 批量导出 Sequence
- JSFL:批量导出swc
- Oracle批量数据导出
- 批量导出查询结果
- POI批量导出数据
- Oracle 批量导出 Sequence
- Mysql批量数据导出
- mysql批量导入,导出
- linux socket阻塞recv
- linux/unix命令详解之sed
- Springframework.beans
- 在linux系统里修改tomcat内存的方法
- 如何在linux CentOS 上安装chrome 谷歌浏览器
- WPF 图像批量导出
- Python爬虫:学爬虫前得了解的事儿
- 【Web】Sublime Text 3常用插件安装
- FutureAndCallable实现异步处理
- JS中Function类型详解
- Presents in Bankopolis CodeForces
- Android微信智能心跳方案
- Ajax中传递Json格式的参数
- Zookeeper 初体验之——JAVA实例