user3290144
user3290144

Reputation: 1

Image Control not displaying in Win Phone 8 Emulator

I'm familiar with C#, but this is my first Windows Phone application so I don't really know what I'm doing. I have a few images (I assume this is the picturebox equivalent from form applications?) on my designer, but when I run it in the emulator they do not show up.

Here is my code:

<Image HorizontalAlignment = "Left" Height= "14" Margin="10,42,0,0" VerticalAlignment = "Top" Width = "14" Source="/Resources/Blackbox.png" Visibility = "Visible"/>

I'm probably missing something very obvious.

Upvotes: 0

Views: 294

Answers (1)

Waleed
Waleed

Reputation: 3145

Make sure your picture's URL is correct, also make sure that the Build action of your image is "Content". If the Build Action is Resource, then you must change your URL pattern to the following format:

/HostAssemblyName;component/UrlToYourImage

Content is much more better in terms of performance compared to Resource.

Upvotes: 1

Related Questions