Cannot insert/locate find .png picture

Viewed 139

I have found some code online that I can use on my own project. It's fairly simple, but when I run the program, I get an error message that it can not find the resource.

I have tried a lot and simply can not see the error - I inserted pictures by saying: add -> new folder (right click) -> added all the images:

 int[] yourHandArray = yourHand.ToInt();
        int[] dealerHandArray = dealerHand.ToInt();

        for (int i = 0; i < yourHandArray.Length; i++)
        {
            switch (i)
            {
                case 0: Card1.Source = new BitmapImage(new Uri("pack://application:,,,/View/img_cards/"+ (yourHandArray[i] + 1) + ".png")); break;
                case 1: Card2.Source = new BitmapImage(new Uri("pack://application:,,,/View/img_cards/" + (yourHandArray[i] + 1) + ".png")); break;
                case 2: Card3.Source = new BitmapImage(new Uri("pack://application:,,,/View/img_Cards/" + (yourHandArray[i] + 1) + ".png")); break;
                case 3: Card4.Source = new BitmapImage(new Uri("pack://application:,,,/View/img_cards/" + (yourHandArray[i] + 1) + ".png")); break;
                case 4: Card5.Source = new BitmapImage(new Uri("pack://application:,,,/View/img_cards/" + (yourHandArray[i] + 1) + ".png")); break;
                case 5: Card6.Source = new BitmapImage(new Uri("pack://application:,,,/View/img_cards/" + (yourHandArray[i] + 1) + ".png")); break;
                case 6: Card7.Source = new BitmapImage(new Uri("pack://application:,,,/View/img_cards/" + (yourHandArray[i] + 1) + ".png")); break;
            }
        }

This is the folder I refer to

0 Answers
Related