前几天一直想引用别的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中的图片删掉了。又用了同样的方法试了一下成功了。很无语。

编程序需要一点点耐心,还有不断积累。

 

最新文章

  1. 一、Redis基本操作——String(原理篇)
  2. tony_iptables_01_linux下IPTABLES配置详解(转)
  3. OCJP(1Z0-851) 模拟题分析(六)over
  4. Unity3D DllNotFoundException/System.DllNotFoundException
  5. 夺命雷公狗ThinkPHP项目之----企业网站26之网站前台列表页的显示和完成分页功能
  6. oracle个人总结
  7. as 中的反射 describeType
  8. Abstract Methods and Classes
  9. java matlab混合编程之返回值Struct类型
  10. Rails 执行 rails server 报错 Could not find a JavaScript runtime
  11. Nodejs的模块系统以及require的机制
  12. sqlite db数据的导出
  13. 洛谷 P1879 解题报告
  14. KVM -&gt; 虚拟机磁盘管理_03
  15. MySQL操作数据库--与MySQL零距离接触1-7
  16. tp5+layui 实现上传大文件
  17. Bellman-Ford模板
  18. [Asp.net MVC]页面伪静态实现
  19. 卷积 &amp; 杜教筛
  20. Sql Server递归查询(转)

热门文章

  1. Linux命令之exit
  2. (转)linux bash shell 入门教程
  3. javascript实现限制上传文件的大小
  4. 任务栈 启动模式 Flag taskAffinity
  5. SqlServer死锁与阻塞检测脚本
  6. oracle 优化 —— 分区表
  7. initWithFrame和initWithCoder区别
  8. java中包的应用
  9. POJ2739 Sum of Consecutive Prime Numbers(尺取法)
  10. 自定义 Preference Header 布局