为大量图像构建动作?
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许是一个构建后步骤,将它们复制到输出文件夹中的已知位置(即 $(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.
解决方案是简单地向我的项目添加一个新文件夹,将现有项目添加到该文件夹,然后突出显示图像并将构建操作设置为编译。 这似乎在调试模式下有效。 我实际上还没有尝试发布该项目。
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.