Name
idx = AddIconImage -- add image to icon (V8.0)
Synopsis
AddIconImage(id, table)
Function
This function can be used to add a new image to the icon specified by id. The image must be specified in the table parameter which must be set to a table that recognizes the following fields:

Type:
This tag allows you to set the source type of the image you wish to add to the icon. This can be #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:
This tag specifies the actual image source and must be set. If 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:
This tag allows you to include an additional image that should be used as a selected version of the image specified in 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:
This tag allows you to set the image that is about to be added as the standard size for the icon. Setting a standard size is important in some contexts, so that Hollywood knows which image to pick for higher resolutions, e.g. if you designate a 64x64 image inside an icon as the standard size, Hollywood knows to pick the 128x128 image in case the monitor's resolution uses a DPI setting that is twice as high as the normal setting. Obviously, there can be only one standard image inside every icon, so if there already is a standard image in the icon, an error is generated.

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.

Inputs
id
identifier of the icon to use
table
table describing the image to be added to the icon (see above)
Results
idx
index where the image has been added (starting at 1)
Example
AddIconImage(1, {Image = "ic16x16.png"})
The code above adds the image file "ic16x16.png" to icon 1.

Show TOC