I'm trying to make a button which upon being pressed will get all the images in a directory and place them in order in an array of images , I have it working so far where it can get the file paths but I cant get it working for images , any ideas ?
here is the code i'm trying to use
private void button2_Click(object sender, RoutedEventArgs e)
{
string[] filePaths =Directory.GetFiles("C:/Users/Pictures/Movements/","*.jpg");
System.Windows.Controls.Image[] Form_moves =new System.Windows.Controls.Image[12];
int i = 0;
foreach (string name in filePaths)
{
Console.WriteLine(name);
Form_moves[i] = filePaths[i] ;
i++;
}
string[] UserFilePaths = Directory.GetFiles("C:/Users/Pictures/Movements/User/", "*.jpg");
foreach (string User_Move_name in filePaths)
{
Console.WriteLine(User_Move_name);
}
}