Visual Studio .NET - How do I add bitmap/picture from resourse folder to xaml form

Asked By David on 09-Oct-12 03:12 AM
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Image Height="13" HorizontalAlignment="Left" Margin="19,82,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="111" Source="/WpfApplication1;component/Images/Balloon.bmp" />
</Grid>
</Window>
 Where in the form does this go is it after Main Window or at the bottom after the code and binding for my buttons. I dont seem to be able to get it to work.
 Should I drag the image box from the toolbox onto the form ?
 Can I drag the Image from the project and drop into the form

Thanks

David

Robbe Morris replied to David on 09-Oct-12 10:59 AM
I suspect the issue is that you are using a BitMap.  If I remember right, the Image control needs to have BitMaps converted to a source it can render:

http://social.msdn.microsoft.com/forums/en-US/wpf/thread/16bce8a4-1ee7-4be9-bd7f-0cc2b0f80cf0/
David replied to David on 09-Oct-12 03:40 PM
 Where in the form does this go is it after Main Window or at the bottom after the code and binding for my buttons. I dont seem to be able to get it to work.
Should I drag the image box from the toolbox onto the form ?
Can I drag the Image from the project and drop into the form

Thanks
David

David replied to David on 11-Oct-12 06:35 AM
Thanks to all but I have now done it and it was so easy.
 Add image to resource folder
 Add image box from tool box to form
 Copy and past image from resourse folder to sourse on the props of image box hey presto done its that easy

 Thanks

 David