Product Documentation
Cadence User Interface SKILL Reference
Product Version IC23.1, September 2023

hiLoadIconFile

hiLoadIconFile(
t_fileName
x_width
x_height
)
=> l_hiIcon / nil

Description

Loads an icon file of any format, such as PNG, and returns the icon in a format that can be used with hi functions that accept icons. If t_fileName is a relative path, the Cadence Search File mechanism (CSF) is used to search for the file.

Multiple resolutions of the icon are loaded, if found. The appropriate resolution is used when the icon is used.

This function provides you the ability to add your own icons for custom toolbars, menus, and forms. You can place these icons in a subdirectory of your home directory. Similarly, central groups can provide icons for your entire site in a different location. Any icons you provide must be placed in an icons/16x16, icons/24x24, icons/32x32, or icons/48x48 subdirectory of a directory found by CSF. These directories should represent the resolution of the image files in them.

Follow these guidelines when you create icons:

Arguments

t_fileName

The name of the icon file to load.

If t_fileName is an absolute path (starting with /), then the file is loaded directly. Only a single resolution is available in this case.

If t_fileName is a relative path, then CSF rules are used to search for all resolutions of the file. For each location in your setup.loc file, the following subdirectories are searched. The names of these subdirectories represent the resolution of the image files in them.

icons/16x16

icons/24x24

icons/32x32

icons/48x48

Whichever resolutions are found are loaded into the icon. When the icon is used, the appropriate resolution is used.

x_width

The desired width of the icon.

The icon that is returned is not sized to the width and height specified; these values are added to the return value of this function and applied when the icon is used.

x_height

The desired height of the icon.

The icon that is returned is not sized to the width and height specified; these values are added to the return value of this function and applied when the icon is used.

Values Returned

l_hiIcon

The icon handle, which can be used with any user interface  function that accepts icons. l_hiIcon is of the following form:

list(handle width height)

nil

t_fileName is not found or there was an error in loading it.

Examples

?itemIcon hiLoadIconFile( "wire.png" 16 16 )

Related Topics

Icon Functions

hiLoadIconFile

hiLoadImageFile

hiLoadIconData

hiSaveIconData

hiStringToIcon

hiMatchColorByName


Return to top
 ⠀
X