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

hiStringToIcon

hiStringToIcon(  
a_colorArray 
t_iconString 
x_width 
x_height 
) 
=> l_hiIcon / nil

Description

Returns an icon description that can be used in hi functions that accept icons, such as hiCreatePulldownMenu, hiCreateMenuItem, hiCreateSliderMenuItem, hiCreateButton, hiCreateCyclicField, hiCreateLabel, and hiAddCyclicChoice.

Arguments

a_colorArray

Array created by hiCreateColorArray. Each element of this array describes a pixel color to use within the icon.

t_iconString

ASCII description of the icon. The maximum string length for t_iconString is 8K (8192) characters.

x_width

Width of the icon.

x_height

Height of the icon.

Values Returned

l_hiIcon

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

list(handle width height)

nil

An error occurred.

Examples

For convenience, the character ‘0’ represents white; the character ‘1’ represents black. Example: to describe an 8x8 pixel icon of a red square surrounded by blue, then thistle on a black background, execute the following (here, spaces are ignored):

myColorArray = hiCreateColorArray( )
myColorArray[0] = hiMatchColorByName( "thistle")
; ‘a’ denotes thistle
myColorArray[12] = hiMatchColor( list( 1000 0 0 )) 
; ‘m’ denotes red
myColorArray[4] = hiMatchColor( list( 0 0 1000)) 
; ‘e’ denotes blue
iconString = "   1   1   1   1   1   1   1   1\
1 a a a a a a 1\
1 a e e e e a 1\
1 a e m m e a 1\
1 a e m m e a 1\
1 a e e e e a 1\
1 a a a a a a 1\
1 1 1 1 1 1 1 1"
myIcon = hiStringToIcon (myColorArray iconString 8 8)

Related Topics

Icon Functions

hiCreateColorArray

hiMatchColorByName

hiStringToIcon

hiSetDisabledIcon


Return to top
 ⠀
X