本文介绍了在C#中打开多个图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从一个文件夹中打开几张图像,每张图像都需要将其转换为二进制格式.如何在folder \ sub文件夹中自动打开几个文件?
现在,我可以通过手动选择openFileDialog一次打开一个文件.
I need to open several images from a folder and with every image I need to convert it to binary format. How can I open several files automatically within folder\sub folders?
Right Now I am able to open 1 file at a time by manually choosing form the openFileDialog.
openFileDialog1.FileName = "";
openFileDialog1.Title = "Images";
openFileDialog1.Filter = "Png Images| *.png";
openFileDialog1.ShowDialog();
if (openFileDialog1.FileName.ToString() != "")
{
Image.ImageLocation = openFileDialog1.FileName.ToString();
img = new Bitmap(openFileDialog1.FileName.ToString());
}
推荐答案
这篇关于在C#中打开多个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!