1

I use this code in XAML:

<Image x:Name="img2" HorizontalAlignment="Left" Width="128" Height="128" Canvas.Left="343" Canvas.Top="192" Source="pack://siteoforigin:,,,/Resources/Trophy-Gold-icon11.png"/> 

I use visual studio 2012. Before running, image control shows assigned image (in designer window) but at execution time, the image is not displayed by image control.

3
  • Make sure image build action is set to Resource. Commented Aug 11, 2013 at 18:13
  • How change build action to Resource ? Commented Aug 11, 2013 at 18:16
  • Select your image in Solution Explorer, switch to the Properties window, and change Build Action to Resource. Commented Aug 11, 2013 at 19:23

1 Answer 1

2

Make sure image build action is set to Resource. (right click on an image and then go to properties, set build action to resource)

Also, instead of siteoforigin use application authority -

Source="pack://application:,,,/Resources/Trophy-Gold-icon11.png" 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.