如何在Visual Studio 2010中添加PNG资源?
我有一个 PNG(即压缩图像),我想将其包含在我的程序集(即应用程序)中。
怎么做呢?
其他信息:
我尝试在 Visual Studio 2010 中将 PNG 资源添加到程序集中:
但这并没有工作,因为 Visual Studio 将其转换为未压缩的位图:
但我想添加 PNG。
]=== 1MB file size ==>
]=== 8MB file size ==============================================================================================================================================>
I have a PNG (i.e. a compressed image) that I'd like to include in my assembly (i.e. application).
How to do it?
Additional information:
I tried adding a PNG resource to my assembly in Visual Studio 2010:
But that didn't work, as Visual Studio converts it to an uncompressed bitmap:
Except I want to add a PNG.
Otherwise my 1MB application becomes 8MB:
]=== 1MB file size ==>
]=== 8MB file size ==============================================================================================================================================>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我可以做到这一点的唯一方法是从 PNG 中删除文件扩展名。这样,Visual Studio 就不会将这些文件识别为图像,并保持它们不变。
The only way I could make this work, is by removing the file extension from the PNGs. That way Visual Studio doesn't recognize the files as images, and leaves them untouched.