如何使用 Visual Studio 在 Windows 应用程序中设置图标

发布于 2025-01-05 07:37:16 字数 154 浏览 3 评论 0原文

我想向我的应用程序添加一个图标。我添加了一个图标资源。及其第一个图标的工作文件。这意味着我编译后,exe文件的16x16图标与使用的图标文件相同。但是当资源管理器窗口放大到大图标大小时,exe 文件的图标就会消失,并显示另一个空白的默认图标。

如何设置大尺寸和小尺寸显示的图标?

I want to add an icon to my application. I have added an icon resource. and its working file for the first icon. That means after I have compiled, the 16x16 icon of the exe file is same as the icon file used. but when the explorer window is zoomed to large icon size, then the icon of the exe file vanishes and another blank default icon is displayed.

How to set icon for large as well as small size display?

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

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

发布评论

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

评论(1

喜爱皱眉﹌ 2025-01-12 07:37:16

从您的评论来看,听起来您为您的项目设置了多个图标文件。这不会按照您想要的方式工作,或者至少这是非常困难的方式

最简单的方法就是让操作系统为您处理。 创建包含多个图标尺寸的单个图标文件。16x16、32x32、48x48 和 256x256 是当前版本的 Windows 所需的最小尺寸,但您当然可以添加更多尺寸(例如 24x24 或 128x128)如果需要,可以提高这些尺寸的像素保真度。

您可以使用 Visual Studio 创建图标。打开 .ico 文件应自动打开其图标资源编辑器。但我个人觉得使用起来很困难或者很麻烦。我强烈建议使用像 IcoFX 这样的第三方程序来创建图标并推动像素。

From your comments, it sounds like you have multiple icon files set for your project. That's not going to work the way you want, or at least it's the really hard way of doing it.

The simple way is to let the operating system handle it for you. Create a single icon file that contains multiple icon sizes. 16x16, 32x32, 48x48, and 256x256 are the minimum sizes needed for current versions of Windows, but you can certainly add more (like 24x24 or 128x128) to improve pixel fidelity at those sizes if desired.

You can use Visual Studio to create the icons. Opening an .ico file should automatically open its icon resource editor. But I personally find it difficult or cumbersome to use. I highly recommend using a third-party program like IcoFX to create your icons and push pixels around.

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