Menu

Toolbar Icons

Help
trlkly
2015-02-11
2016-12-31
  • trlkly

    trlkly - 2015-02-11

    I seem to be unable to set an icon for the script toolbar. If I set an
    icon, the button doesn't appear. It doesn't matter if I use an ico file or
    a bmp file.

    Attached are an example of the icons/bmps I've tried using. Is there some
    sort of restriction on size or bitdepth?

     
  • Dave Brotherstone

    There are restrictions, but because it just passes the image on to N++, I don't know exactly what they are. Pretty sure it's a 256 colour BMP though. The "standard" Python logo image is here : https://github.com/bruderstein/PythonScript/blob/master/PythonScript/res/python.bmp - that works, and has a "transparent" background, so if you can use that as a template, that should work.

    Dave.
    PS. Sorry for the delay in replying.

     
  • Krzysiu

    Krzysiu - 2016-04-16

    Hello! Thanks, Dave, for providing sample file. I found a way to convert image to icon supported by N++ using ImageMagick(1). BTW if you need simple text icons, you can use my tool: Krzysiu Icon Generator. It's in Polish, but it's very simple. You can choose text, fg and bg color, font face and size. If anybody would want it, please message me and I'd add generation of BMP3 to that website, so you wouldn't have to have IM/convert it by yourself.

    The format is BMP3 (3! Very important!), 16x16, 8 bit, optionally with alpha (which isn't supported by BMP3, yet still one can use it).

    You can use other formats on input, like .ico. Your file needs to have alpha, this command won't convert color to alpha. If you don't want alpha, delete whole "-define bmp3:alpha=on".

    The command is:

    c:\imagemagick\convert someIcon.png -define bmp3:alpha=on "bmp3:workingIcon.bmp"
    

    For batch processing (converts all ico files in current directory; if you want to overwrite files, remove "if not exist "%%~f.bmp"):

    @echo off
    for %%f in (*.ico) do (
        if not exist "%%~f.bmp" convert "%%f" -define bmp3:alpha=on "bmp3:%%~nf.bmp"
    )
    

    The attached file shows generated icon by said script and then converted using IM.

    (1) If you don't know this tool at all, just download the static (binary executables) Q8 (8 bit, if you don't mess with pro TIFF files or camera raws, it's ok) version. You would have to use full path to executable, because Windows already have tool named "convert". In new (now alpha) version (IM 7) you would need to change "convert" to "magick".

     

    Last edit: Krzysiu 2016-04-16
  • Guillaume

    Guillaume - 2016-12-31

    I also coul not add them (no error message). Size were too big, I did change them into 32x32. And I did change the extension from .ico to bmp and it worked.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.