as I\'m fairly new to C# and WPF I just can\'t figure out how to do this. I have a form that should show 151 images (all pokemon generation 1 sprites) in a form. The way I\'
You need to define your bitmap inside the loop, not outside. Then each iteration will create a new bitmap with the new path.
so something like:
for (int i = 0; i < imgCount; i++)
{
// padding left will give you 001 and 010 and 151
string img = i.ToString().PadLeft(3, '0');
BitmapImage carBitmap = new BitmapImage(new Uri("pack://application:,,,/Images/All_Sprites/" + img+".png", UriKind.Absolute));
// the rest of your code
}