图像路径问题 [C#、WPF]
我需要在 2 个 .NET 程序集中使用图像。第一个是 WPF 应用程序 {myApp.exe},第二个是 *.dll {myDll.dll}。文件位于此文件结构中:
**AppFolder** consist these files and one subfolder(avatars): -myApp.exe -myDll.dll -avatars {folder} consist: -manImages.jpg -womanImages.jpg
我尝试采用此格式的用户 uri
new Uri(@"C:\Users\avatars\manImages.jpg", UriKind.RelativeOrAbsolute);
,但此格式不起作用,图像为空。
I need use images in 2 .NET assemblies. One is WPF app {myApp.exe} and second is *.dll {myDll.dll}. File are located in this file structure:
**AppFolder** consist these files and one subfolder(avatars): -myApp.exe -myDll.dll -avatars {folder} consist: -manImages.jpg -womanImages.jpg
I try user uri in this format
new Uri(@"C:\Users\avatars\manImages.jpg", UriKind.RelativeOrAbsolute);
but this format does not work, images are empty.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我期望
工作吗?
您还可以尝试:
I would expect
to work?
You could also try:
在dll端你可以这样写:
On the dll side you can write this: