问题
Possible Duplicate:
WPF image resources
I have some images in my VS C# project that are declared as embedded resources. I'm accessing them in the .cs file using:
Stream logoStream = GetType().Assembly.GetManifestResourceStream("ProjNS.Image.logo.png");
Bitmap logo = new Bitmap(logoStream);
But how can I access my logo in the .xaml file?
回答1:
Call the Resource like this;
<Image Source="Resources/ProjNS.Image.logo.png" height="100" width="100"/>
来源:https://stackoverflow.com/questions/5076927/wpf-accessing-an-embedded-resource-in-xaml