如何在没有 Visual Studio 的情况下使用嵌入到应用程序中的资源
我有一个使用 winforms 的 GUI 项目,并且想在其中使用一些图标。 我不使用 Visual Studio 来实现此目的,而是使用 dotnet cli 构建它。 虽然从单独的文件加载它们时它可以工作,但我希望它们作为资源放在可执行文件中。我通过 csproj 中的此条目添加了整个文件夹:
<EmbeddedResource Include="Resources\*.png" />
但是我如何引用它们并将它们加载到 Image 对象中? 我发现的所有示例都使用 Visual Studio 的 GUI。
I have a GUI project using winforms, and want to use some icons inside it.
I don't use Visual Studio for this, but build it with dotnet cli.
While it is working when they are loaded from seperate files, i want them inside the executable as a resource. I added the whole folder via this entry in the csproj:
<EmbeddedResource Include="Resources\*.png" />
But how would i reference them and e.g. load them into an Image object?
All examples i have found are using the GUI of Visual studio for it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论