WPF - 如何引用external dll中图片
2024-09-25 13:17:10
前几天一直想引用别的DLL里面的一个图片。总是出现各种各样问题,一气之下将图片拷贝到当前Project中,运行良好。虽然知道引用图片,就1.2.列出来的2点就够了。
1. The Build Action should be Resource instead of Embedded Resource.
2. In the WPF application with the following XAML:
<Image Source="/ClassLibraryName;Component/images/myimage.png"/>
The important thing here is "ClassLibraryName" which is the assembly name for your class library. "/images/myimage.png" is the path to your image.
You can find out more about WPF pack URIs here: http://msdn.microsoft.com/en-us/library/aa970069.aspx
今天把Project中的图片删掉了。又用了同样的方法试了一下成功了。很无语。
编程序需要一点点耐心,还有不断积累。
最新文章
- 一、Redis基本操作——String(原理篇)
- tony_iptables_01_linux下IPTABLES配置详解(转)
- OCJP(1Z0-851) 模拟题分析(六)over
- Unity3D DllNotFoundException/System.DllNotFoundException
- 夺命雷公狗ThinkPHP项目之----企业网站26之网站前台列表页的显示和完成分页功能
- oracle个人总结
- as 中的反射 describeType
- Abstract Methods and Classes
- java matlab混合编程之返回值Struct类型
- Rails 执行 rails server 报错 Could not find a JavaScript runtime
- Nodejs的模块系统以及require的机制
- sqlite db数据的导出
- 洛谷 P1879 解题报告
- KVM ->; 虚拟机磁盘管理_03
- MySQL操作数据库--与MySQL零距离接触1-7
- tp5+layui 实现上传大文件
- Bellman-Ford模板
- [Asp.net MVC]页面伪静态实现
- 卷积 &; 杜教筛
- Sql Server递归查询(转)