my project is about recording screen as sequence of images then instead of make it as video i planed to load all image directories to list and use timer to view them image by image, but i get files in wrong order like this:
this code is to load files from directory:
string[] array1 = Directory.GetFiles("C:\\Secret\\" + label1.Text, "*.Jpeg");
Array.Sort(array1);
foreach (string name in array1)
{
listBox1.Items.Add(name);
}
timer2.Start();
this code to view them
int x = 0;
private void timer2_Tick(object sender, EventArgs e)
{
if (x >= listBox1.Items.Count)
{
timer2.Stop();
}
else
{
ssWithMouseViewer.Image = Image.FromFile(listBox1.Items[x].ToString());
x++;
}
}
i need to view them in order like 0.jpeg, 1.jpeg, 2.jpeg.....10.jpeg, 11..jpeg...