100分问关于uri使用某个dll image 资源的问题?急,在线等.....分不够可以再加多少都可以
我看到"Windows.Presentation.Foundation.Unleashed.Dec.2006.pdf"中提到关于uri的用法,如下:
"MyDll;Component/logo.jpg"
Embedded in a different assembly called MyDll.dll or MyDll.exe
"MyDll;Component/A/B/logo.jpg"
Embedded in a different assembly called MyDll.dll or MyDll.exe using an internal subfolder structure (A\B) defined at compile time
后面又描述了它的格式:
Accessing Resources Embedded in Another Assembly
The ability to easily access binary resources embedded in another assembly is very handy
(and gives you more options for updating resources without needing to replace the main
executable), but the syntax is a little bizarre. As Table 8.1 implies, the syntax is
AssemblyReference;Component/ResourceName
///////////////////////////////////////////////////////////////////////////
我在我的工程中新建了一个dll工程"dllProject" ,并加入了一些image.
在使用uri的中程中引用的dllProject,并使用了下面的语句去调用image资源:
bmpImg.UriSource = new Uri("AcpResource;Component/add.bmp");
但每次运行到这里就报异常,请问是什么问题,请高手们指点一下!先谢了!