如何调整 Windows 图标覆盖的大小?
我对我的文件 *.myfile
制作了一个图标叠加层,但叠加层大小错误。当图标以 16x16 大小显示时,覆盖层会覆盖该图标。
如何更改覆盖尺寸? (IShellIconOverlayIdentifier
)
I made a icon overlay to my file, *.myfile
, but the overlay size is wrong. When the icon shows in size 16x16, the overlay covers the icon.
How can I change the overlay size? (IShellIconOverlayIdentifier
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法更改叠加大小。请改用多分辨率图标文件,其中所有必要的尺寸都可用。
要获得一个很好的示例,请查看TortoiseSVN 源。它们将仅使用一个图标文件,但如果您使用适当的绘画工具打开它,您将看到该文件包含不同的大小。
更新
如果您仔细查看第一种方法,您将收到以下评论:
您可以在第 129 行看到它尝试从注册表中查找所需文件的路径。通过浏览代码您可以找到 颠覆中的图标。在线165 你可以看到它从注册表中获取文件名并将其写回其输出参数,也许让 Windows 决定应从文件中获取哪个大小的神奇标志是 *pdwFlags = ISIOI_ICONFILE; 。
You can't change the overlay size. Instead use a multi-resolution icon file where all necessary sizes are available.
For a good example take a look into the source of TortoiseSVN. Their will be only one icon file used, but if you open it with an appropiate paint tool, you'll see that this file contains different sizes.
Update
If you take a look right at the first method, you'll get the following comment:
You can see in line 129 that it tries to find out the path of the needed file from the registry. By browsing the code you can find the icons in subversion here. In line 165 you can see that it takes the filename from the registry and writes it back to its out parameters and maybe the magic flag to let windows decide which size should be taken from the file is
*pdwFlags = ISIOI_ICONFILE;
.