I have a WPF application, in which I want to insert an image. It shows up just fine in the design, but once I run the program nothing is displayed. The image is imported and stored using Project > Properties > Resources.resx and is located in the folder "Resources" as you can see in the screenshot in the bottom. The XAML code is quite simple:
<Image
Source="/Resources/warning_icon_32x32.png"
Width="32"
Height="32"
HorizontalAlignment="Left" />
Why does this not work? As you can see below, it works fine in the designer.
EDIT
If I use the full path of the image (i.e. C:\...
) then it works. However this would break as soon as it was opened on a different PC, so it's hardly a solid solution. It it interesting though...