AddIconImage(id, table)
id
. The image
must be specified in the table
parameter which must be set to a table that recognizes
the following fields:
Type:
#BRUSH
if you want to add a brush, or #FILE
if you would
like to add an image from an external file source. The default is #BRUSH
. Note
that that default is different to the default used by the @ICON
preprocessor command, which is #FILE
.
Image:
Type
has been set to #BRUSH
, you have to set this tag to the identifier of
a brush you want to add to the icon. Otherwise, Image
needs to be set to the
path of an image file that should be added to the icon. The image file may be in
any of the image file formats supported by Hollywood. Note that if the image file
specified here has an alpha channel, the alpha channel data is loaded automatically.
Also note that in every icon, each image size must only be used once, i.e. it is not
possible to add two 48x48 images to a single icon. There can only be one image
for each size in every icon. Also note that it's not possible to add a vector
graphics image to an icon because vector icons must only contain a single image.
See CreateIcon for details.
SelImage:
Image
. This tag is optional.
If you set it, the image specified here must be of exactly the same size as
the one specified in Image
. Besides that, SelImage
is used in the very
same way as Image
, i.e. it depends on the image type set in Type
what you
have to pass here, either a brush identifier or a path to an external image
file.
Standard:
AddIconImage()
returns the index where the image has been added inside the
icon. Note that this isn't necessarily the last index in the icon because
the individual images inside icons are sorted by their width in ascending
the order. The indices returned by AddIconImage()
start at 1.
To remove an image from an icon, use the RemoveIconImage() function.
AddIconImage(1, {Image = "ic16x16.png"})The code above adds the image file "ic16x16.png" to icon 1.