user3509128
user3509128

Reputation: 142

C# xaml image not showing up in application

When I try to display some smaller (72x72) images in my xaml file as a 20x20 image, they work fine, but when I try to use one that's 96x96, they just don't show up. Here is the code:

<Image Source="/Images.Toolbox;component/Images/defaultIcon.jpg" Height="20" Width="20" Stretch="None"/>

This is how it looks like with the 72x72, how I want it to look.

enter image description here

And this is how it looks when I try to use my 96x96 image.

enter image description here

The working one is a .ico, .png also works. The nonworking one is a .jpg, but this shouldn't matter should it?

Upvotes: 3

Views: 7916

Answers (1)

Eren Ers&#246;nmez
Eren Ers&#246;nmez

Reputation: 39085

  • Visual Studio > Solution Explorer
  • right-click on the image file > Properties
  • make sure the Build Action is set to Resource.

Upvotes: 14

Related Questions