0
我有一个库项目,我使用它作为一个使用MvcContrib的可移植区域项目。如何从MvcContrib后面的代码访问嵌入式资源?
在Library
项目里面,我从后面的代码访问本地图像。
string imagePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, string.Format("Controls\\images\\expander_opened_hover.png"));
using (Bitmap bmp = (Bitmap)Bitmap.FromFile(imagePath))
{
// do somthing with this image
}
的代码运行在Library
项目,但是当我从“主机”项目访问相同的功能,我得到该文件未找到错误。该文件在Library
项目中设置为Embedded Resource
,但它在主机项目中不存在。
我该如何设置路径,以便它可以找到嵌入的图标?
精彩!谢谢 – Catalin