Q: displaying image in WPF

  • Thread starter G. Ralph Kuntz, MD, MS
  • Start date
G

G. Ralph Kuntz, MD, MS

I am probably doing something really stupid, but I cannot get an image
to display in a window using WPF.

I copied the image into my main project directory in Visual Studio
2005.

I added the appropriate lines to my XAML file:

<Image DockPanel.Dock="Top" Margin="5" Source="myimage.png" />

The image displays fine in the design view, but when I build the
project and run it, the image does not show. Other controls move to
fill the space where the image should be.

Any ideas?

Thanks, Ralph
 
G

G. Ralph Kuntz, MD, MS

Never mind. I needed to right click on the image and tell VS to copy
it to the ouput directory if newer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top