WPF: Accessing an embedded resource in XAML [dupli

2019-06-17 03:37发布

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条回答
Emotional °昔
2楼-- · 2019-06-17 04:12

Call the Resource like this;

<Image Source="Resources/ProjNS.Image.logo.png" height="100" width="100"/>
查看更多
登录 后发表回答