I already did this:
var uriSource = new Uri(@"/WpfApplication1;component/Untitled.png", UriKind.Relative);
image1.Source = new BitmapImage(uriSource);
My namespace is WpfApplication1, my image is at main folder of the project.
It still doesn’t work. What am I doing wrong?
It’s already set to Resource. When I debug, it says these erros:
Height = ‘image.Source.Height’ threw an exception of type ‘System.IO.DirectoryNotFoundException’
Metadata = ‘(image.Source).Metadata’ threw an exception of type ‘System.NotSupportedException’
Damn it, it’s simple as Silverlight. But it doesn’t support png files to do like this.
So this how I did to work. Just changed to a jpg image: