Q: displaying image in WPF

  • Thread starter Thread starter G. Ralph Kuntz, MD, MS
  • Start date 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
 
Never mind. I needed to right click on the image and tell VS to copy
it to the ouput directory if newer.
 
Back
Top