I have a module called xModule
. I have an image inside it marked as embedded resource
.
Inside the initialization of the module I tried :
string stFileName = "SmallIcon.png";
string stAssembly = "xModule"; // That's the full name of the assembly
//img.BeginInit();
Uri uri = new Uri(String.Format(@"/{0};component/Images/{1}", stAssembly , stFileName),
UriKind.Relative);
ImageSource imgSource = new BitmapImage(uri);
During it's coming to the breakpoint on the ImageSource imgSource =..
line, it seems the ImageSource
can't find the image...
Why? What's wrong with it?
I get no errors, the assembly is referenced. I did something similar in the Xaml and it worked. Also used : VS11, Unity