4

I have the following problem: I was included a folder into my WPF project. Build Action set to: Content Copy to output directory set to: Copy Always Folder name: Images I used the following code in my WPF .XAML:

<Image Name="ImagesFolder" MouseWheel="ImagesFolder_MouseWheel" Width="320" Height="230"  Grid.Row="1" Margin="31,215,29,136">
    <Image.Source>
        <BitmapImage UriSource="Images/1.png"/>
    </Image.Source>
</Image>

The image shows in the designer window,so the program find it, but when I run it I just can't see the image in it's place. Tried it with a Canvas + Border combo around also. On the other hand I will use sometimes 2 sided pictures. So if i have 5 pictures, like this : 1,1_2,2,3,4 I want the program to rotate my picture with some kind of code on a button click event. How to do it (every pictures background will be the actual picture number of the foreground + _actual picture number of foreground)? Thank you for your help!

daniele3004
  • 13,072
  • 12
  • 67
  • 75
Tom026
  • 65
  • 3
  • 10

1 Answers1

8

You had to set Build Action to 'Resource' and specify source in format: '/Your.Assembly.Namespace;component/Images/1.png'

al_amanat
  • 615
  • 3
  • 10