Hi,
I am implementing a code which uses the FolderBrowserDialog control. Here is my code :
FolderBrowserDialog folder = new FolderBrowserDialog();
DialogResult result = folder.ShowDialog();
if (result == DialogResult.OK)
{
try
{
string path = folder.SelectedPath;
string[] files = Directory.GetFiles(path, "*.jpeg");
foreach (string file in files)
{
using (Stream s = File.Open(file, FileMode.Open))
{
srcImage = Bitmap.FromStream(s) as Bitmap;
}
this.pictureBox1.Image = srcImage;
this.pictureBox1.Width = this.pictureBox1.Image.Width;
this.pictureBox1.Height = this.pictureBox1.Image.Height;
this.Invalidate();
//do something else
}
What I am basically trying to do is, I read the images in the selected folder and perform some operations on each image(this part worked fine so far). The trouble is that this coding takes only one image from the folder and performs the operations and terminates. The rest of the images are not considered. Any ideas why it happens like this