Isotropix Forums

iconrc usage

Clarisse Scripting related topics

iconrc usage

Unread postby danielefederico » Fri Nov 29, 2019 3:14 pm

Hello everyone,
I'm trying to use iconr2rc to create icon file, but with little luck.

I'm trying to use it in this way:
icons2irc.exe -icon_path C:\projects\icons -icon_name myfile.png -output_path C:\projects\out_icons

But I keep getting this error message:
Failed to find valid image files to create the icon 'myfile.png'

I also tried running it by passing directly the icon folder as argument, but apparently the tool does not do anything . It only prints this warning:
libpng warning: iCCP: known incorrect sRGB profile

Also another question: what is the correct size for icons to use in a cid file so that it appears correctly in the menu and browser? Is 32x32 ok?

Thanks,
Daniele
danielefederico
 
Posts: 1
Joined: Mon Oct 28, 2019 12:56 pm

Re: iconrc usage

Unread postby dcourtois » Mon Dec 02, 2019 11:25 am

Hi,

There's a helper CMake function that you should use:
Code: Select all
icons2irc(target_name "${CMAKE_CURRENT_SOURCE_DIR}/icon_folder" "icon_name;second_icon_name")


target_name is the name of your library or module target.
the second argument is the folder where your icons are located.
the third argument is a ; separated list of the names of the icons you want to generated. Those are the names of the icons files without extension and without size info.

Usually we provide a 16x16, a 32x32 and a 256x256 version. So with the previous CMake example, your "icon_folder" would contain the following files:

  • icon_name_16.png
  • icon_name_32.png
  • icon_name_256.png
  • second_icon_name_16.png
  • second_icon_name_32.png
  • second_icon_name_256.png

Then in your cid file, just use the resulting iconrc like this:
Code: Select all
class "MyGeometryBundle" "GeometryBundle" {
    icon "./icon_folder/icon_name.iconrc"

    // ...
}
User avatar
dcourtois
 
Posts: 55
Joined: Tue Jul 25, 2017 3:15 pm


Return to Scripting