WPF - 如何引用external dll中图片
2014-05-07 17:04
661 查看
前几天一直想引用别的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:
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. 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中的图片删掉了。又用了同样的方法试了一下成功了。很无语。
编程序需要一点点耐心,还有不断积累。
相关文章推荐
- WPF 如何将软件的所有图片保存在DLL内供主程序调用
- WPF 引用DLL纯图像资源包类库中的图片
- WPF 引用DLL纯图像资源包类库中的图片
- WPF 引用DLL纯图像资源包类库中的图片
- 引用zepto jquery图片懒加载 浏览器如何测试
- 如何在SharePoint 2010项目中引用UserProfiles.dll
- [WPF] 嵌入资源到DLL,并解决PNG图片问题
- 在DLL组件中附加图片等资源,并在程序中引用_2
- C#工程引用dll如何配置
- .net程序如何把引用的dll放到子目录里面
- wpf如何引用字体文件
- 如何在WPF中引用Windows.System.Forms.Integration
- 如何直接引用微信的图片链接详解
- Cocos2d-x win7 + vs2010 配置(如何创建cocos2d-x工程,解决各种头文件包含错误、lib库引用错误 及dll链接错误)
- C++ win32 dll 引用外部CLR,加载托管程序集异常-Error 10 error LNK2019: unresolved external symbol _CLRCreateInstancet
- JNI引用C++dll若干问题总结-如何导出C++中的类成员函数
- Android Studio中如何引用图片资源
- .Net中把图片等文件放入DLL中,并在程序中引用
- VS2005、VS2008中如何屏蔽讨厌的MSVCR*.dll的引用
- java工程打包成可执行的jar包后,如何正确引用jar包里的图片