0

I have a set of images that load from my solutions resource file, now they show up fine in design mode and in Blend but they won't show up at all when I actually run the program.

Here is the markup of the controls

<WrapPanel x:Name="heartsWrapPanel" Height="25.97" Canvas.Left="437.94" Canvas.Top="594.83" Width="75.26">
    <Image x:Name="heart1" Height="22.388" Width="24.777" HorizontalAlignment="Left" VerticalAlignment="Bottom" Source="pack://siteoforigin:,,,/Resources/heart.png"/>
    <Image x:Name="heart2" Height="22.388" Width="24.777" HorizontalAlignment="Left" VerticalAlignment="Bottom" Source="pack://siteoforigin:,,,/Resources/heart.png"/>
    <Image x:Name="heart3" Height="22.388" Width="24.777" HorizontalAlignment="Left" VerticalAlignment="Bottom" Source="pack://siteoforigin:,,,/Resources/heart.png"/>
</WrapPanel>

Now I can't figure out what's wrong, there's nothing wrong with the wrap panel as I've tried to put in other elements in it and they show up fine, and like I said the images show up in design mode and in Blend but it won't show up during runtime.

Overly Excessive
  • 2,095
  • 16
  • 31

1 Answers1

2

you have to set the "Build Action" to "Resource" for Images and maybe change to Source=Resources/XXX.png"

Mate
  • 4,976
  • 2
  • 32
  • 38