Home All Groups Group Topic Archive Search About

Q: displaying image in WPF

Author
19 Nov 2007 7:58 PM
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

Author
19 Nov 2007 10:19 PM
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.

AddThis Social Bookmark Button