如何在不更改每个子图像的情况下更改 MFC 应用程序的图标?
当我使用 Visual Studio 2008 打开 MFC 项目的应用程序图标时,有 13 个图像(不同大小、不同调色板)。如何在不更改每个图像的情况下更改 MFC 应用程序的图标?
谢谢!
when I open the application icon of a MFC-project with Visual Studio 2008 there are 13 images (different sizes, different color palette). How would you change the icon of your MFC-application without changing each image?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我喜欢将 图标文件类型扩展 与 一起使用Paint.NET。当您打开 .ICO 文件时,它会提示您打开哪个图像 - 仅选择最大/最高位图像。进行更改,然后保存。系统将提示您保存哪些大小和位数 - 选择原始图标中存在的相同列表。
使用此方法,您将获得较小尺寸的自动缩放和抖动图标。设计师实际上会调整每个尺寸的图标以获得最佳外观,但对于大多数应用程序来说,这种技术产生的东西是可用的。
I like to use the Icons file type extension with Paint.NET. When you open a .ICO file it will prompt you for which image to open - select only the largest / highest-bit image. Make your changes, and then save. You will be prompted for which sizes and bitness to save - select the same list that was present in the original icon.
Using this method, you will get automatically scaled and dithered icons at the smaller sizes. A designer would actually tweak the icons at each size to get the best look, but for most applications this technique produces something that is usable.
图标资源通常包含图标的许多不同版本。对于应用程序图标,您期望的尺寸为 16x16、32x32、48x48 和 256x256。您还希望看到 3 个较小的 32 位颜色、8 位颜色和 4 位颜色。或者一些变体。 Microsoft 发布指南。
为什么同一个图标有这么多不同的版本?
嗯,图标会在不同的设置下绘制。在窗口标题栏上,通常会显示 16 像素版本。在 Windows 7 任务栏上将显示 48px 版本。当在 XP 中使用 ALT+TAB 时,将显示 32px。在具有超大图标视图的 Vista/7 资源管理器中,将显示 256px。
为了获得最佳的视觉外观,您必须具有不同尺寸的不同版本的图像,因为小光栅图像不容易缩放。此外,您可能会在不同的分辨率下呈现略有不同的图标版本。例如,您只能在较大分辨率、部分透明版本上使用 3D 效果。
使用远程桌面时,如果连接受到带宽挑战,则可以使用较低的颜色深度。
MS 指南详细讨论了这些问题。
图形设计师设计图标的正常做法是,一旦您对图标感到满意,设计师将生成所有所需尺寸和颜色深度的光栅化版本,通常在单个 .ico 文件中。
An icon resource typically contains many different versions of an icon. For an application icon you would expect 16x16, 32x32, 48x48 and 256x256. You'd also expect to see the 3 smaller ones at 32 bit colour, 8 bit colour 4 bit colour. Or some variant on that. Microsoft publishes guidelines.
Why so many different versions of the same icon?
Well, the icon will be drawn in different settings. On a window caption bar, the 16px version will typically be shown. On the Windows 7 taskbar the 48px version will be shown. When usint ALT+TAB in XP the 32px will be shown. In Vista/7 explorer with ultra large icon view, the 256px will be shown.
To obtain the best visual appearance you must have different versions of the image for different sizes because small raster images aren't easy to scale. What's more, you may present a slightly different version of the icon at different resolutions. For example you may use 3D effects only on larger resolution, partial transparency versions.
When using remote desktop, lower colour depths may be used if the connection is bandwidth challenged.
The MS guidelines go into these issues in detail.
The normal practice of for the graphic designer to design the icon and once you are happy with it the designer will produce rasterised versions for all the required sizes and colour depths, typically in a single .ico file.