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
Values Returned
|
The icon handle, which can be used with any hi function that accepts icons. l_hiIcon is of the following form: |
|
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
Return to top