如何使用单独程序集的嵌入图像?
SO中有很多相关的问题/答案。 我看了其中一些,但没有一个真正匹配。
程序集(称为 ResourcesLoader)将图像作为嵌入资源保存。
我想在另一个程序集中使用这些图片。
在查看了 msdn pack uri 并看到大量示例之后,我认为以下行可以完成这项工作:
<Image Source="pack://application:,,,/ResourceLoader;component/Resource Files/Bitmaps/bmp20x20/Cancel.png" />
猜猜怎么着? 这是行不通的! 我逐字核对了好几遍,确保没有错误。
我尝试使用资源图像并且它有效。 但我必须使用嵌入式资源...
谁可以给我神奇的语法? 谢谢!
there are many related questions/answers about that in SO. I took a look to some of them but none really match.
An assembly (called ResourcesLoader) holds images as embedded ressources.
I would like to use these pictures in another assembly.
After looking at msdn pack uri, and seeing a lots of samples, I thought that the following line would do the job :
<Image Source="pack://application:,,,/ResourceLoader;component/Resource Files/Bitmaps/bmp20x20/Cancel.png" />
Guess what? It does not work! I have checked letter by letter several times to make sure there is no mistakes.
I tried with resource images and it worked. But I have to use embedded resources...
Who can give me the magical syntax? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该资源上设置的构建操作是什么? 构建操作应该是资源而不是嵌入式资源。
What is the build action set on this resource?. The Build Action should be Resource instead of Embedded Resource.