为大量图像构建动作?

发布于 2024-07-23 09:10:09 字数 182 浏览 4 评论 0原文

我在 Visual Studio 2008 中,有一个加载大量图像的项目。 我希望将图像部署到正在运行的软件的本地实例。 问题是我尝试使用图像作为资源,但显然图像太多(200 到 300 个),因为我遇到了奇怪的构建错误,例如 GDI+ 异常和内存不足异常。 这让我开始思考:“也许我的做法是错误的?” 我应该如何处理我的大量图像? 谢谢!

I'm in Visual Studio 2008 and I have a project that loads lots of images. I want the images to be deployed to the local instance of the software running. The trouble is that I tried using the images as a resource, but there are apparently too many(200 to 300) because I get strange build errors like GDI+ exceptions and Out of Memory Exceptions. This got me to thinking: "Maybe I'm going about it wrong?" What should I be doing for my large set of images? Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月棠 2024-07-30 09:10:09

也许是一个构建后步骤,将它们复制到输出文件夹中的已知位置(即 $(target_dir)\images),然后让程序从磁盘加载它们。

Maybe a post-build step to copy them to a known location in the output folder (ie $(target_dir)\images) then let the program load them from disk.

瞄了个咪的 2024-07-30 09:10:09

解决方案是简单地向我的项目添加一个新文件夹,将现有项目添加到该文件夹​​,然后突出显示图像并将构建操作设置为编译。 这似乎在调试模式下有效。 我实际上还没有尝试发布该项目。

The solution was to simply add a new folder to my project, add existing items to the folder, and then highlight the images and set the build action to compile. This seems to work in Debug mode. I haven't actually tried to release the project yet.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文