简体   繁体   English

Windows 自定义图标大小 (NSIS)

[英]Windows Custom Icons Sizes (NSIS)

I used NSIS to create an installer for my app, which has a custom .ico icon included which is used to create the shortcut created on the desktop.我使用 NSIS 为我的应用程序创建了一个安装程序,其中包含一个自定义的.ico图标,用于创建在桌面上创建的快捷方式。

In NSIS I used this to create the icon.在 NSIS 中,我用它来创建图标。

CreateShortCut "$DESKTOP\AppName.lnk" "${PATH_TO_EXE}" "C:\PATH\TO\ICON\AppIcon.ico" "C:\PATH\TO\ICON\AppIcon.ico" 0

It worked fine until I used Ctrl+Mouse wheel to resize the desktop icons, which resized the icon up until a point and then defaulted to the default windows icon.它工作正常,直到我使用 Ctrl+鼠标滚轮调整桌面图标的大小,将图标调整到一个点,然后默认为默认的 Windows 图标。

I then read here that different sizes of icons is used to achieve different things.然后我在这里读到不同大小的图标用于实现不同的事情。

Example例子

Windows 7:

    Explorer views:
        Details / List / Small symbols: 16
        All other options: 256 (resized, if necessary)
    Right-click->Properties / choosing a new icon: 32
    Pinned to taskbar: 32
        Right-click-menu: 16
    Desktop:
        Small symbols: 32
        Medium symbols: 48
        Large symbols: 256 (resized, if necessary)
        Zooming using Ctrl+Mouse wheel: 16, 32, 48, 256

So it's clear that I need different icon sizes, so where do I place the different icons, how to I rename them and how do I add them with NSIS so that windows can automatically use the correct icon?所以很明显我需要不同的图标大小,那么我应该在哪里放置不同的图标,如何重命名它们以及如何使用 NSIS 添加它们以便窗口可以自动使用正确的图标?

You can specify multiple icon sizes within the same .ico file, no need to create new files.您可以在同一个.ico文件中指定多个图标大小,无需创建新文件。 My guess is that every icon editor can handle multiple sizes, otherwise have a look at this online editor .我的猜测是每个图标编辑器都可以处理多种尺寸,否则看看这个在线编辑器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM