如何调整 Windows 图标覆盖的大小?

发布于 2024-12-28 02:29:27 字数 225 浏览 6 评论 0原文

我对我的文件 *.myfile 制作了一个图标叠加层,但叠加层大小错误。当图标以 16x16 大小显示时,覆盖层会覆盖该图标。

如何更改覆盖尺寸? (IShellIconOverlayIdentifier)

左边是我的,右边是 tortoisesvn

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)

left is mine, right is tortoisesvn

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

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

发布评论

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

评论(1

凉宸 2025-01-04 02:29:27

您无法更改叠加大小。请改用多分辨率图标文件,其中所有必要的尺寸都可用。

要获得一个很好的示例,请查看TortoiseSVN 源。它们将仅使用一个图标文件,但如果您使用适当的绘画工具打开它,您将看到该文件包含不同的大小。

更新

如果您仔细查看第一种方法,您将收到以下评论:

“Shell 调用 IShellIconOverlayIdentifier::GetOverlayInfo 来请求
处理程序图标覆盖的位置。图标覆盖处理程序返回
包含覆盖图像的文件的名称及其索引
那个文件。然后,Shell 将图标叠加层添加到系统图像列表中。”

您可以在第 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:

"The Shell calls IShellIconOverlayIdentifier::GetOverlayInfo to request the
location of the handler's icon overlay. The icon overlay handler returns
the name of the file containing the overlay image, and its index within
that file. The Shell then adds the icon overlay to the system image list."

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;.

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