SaveIcon -- save icon to a file (V8.0)
SaveIcon(id, f$[, fmt, t])
This function saves the icon specified by id to the file specified by f$ in By default, the icon will be saved in Hollywood's custom icon format based on PNG. You can change this by passing a different icon format constant in the fmt argument. The only icon format supported internally by Hollywood is #ICNFMT_HOLLYWOOD, which is Hollywood's custom icon format based on PNG. Additional icon formats might be made available by Hollywood plugins.

Note that although Hollywood's custom icon format stores icons as seemingly normal PNG images, they contain additional metadata which is why you mustn't edit them with your favourite image manipulation tool because that might lead to the loss of said metadata. Hollywood icons should only ever be created by using the SaveIcon() function.

Also note that when using Hollywood's custom icon format the icon specified in id mustn't contain any vector graphics. Hollywood icons only support raster graphics because they are based on PNG which is a raster graphics format. If you want to use vector graphics in an icon, you can create such icons using the CreateIcon() function and the @ICON preprocessor command.

Finally, icons in Hollywood's custom icon format also mustn't contain any palette graphics. That is why SaveIcon() will fail if the icon specified by id contains palette images.

Starting with Hollywood 9.0, SaveIcon() accepts an optional table argument that can contain the following options:

For icon formats that support compression, you can set this tag to True or False to enable or disable compression. Defaults to True. (V9.0)

This tag allows you to specify one or more file adapters that should be asked if they want to save the specified file. If you use this tag, you must set it to a string containing the name(s) of one or more adapter(s). Defaults to the adapter set using SetDefaultAdapter(). See Loaders and adapters for details. (V10.0)

This tag can be used to specify additional data that should be passed to loaders and adapters. If you use this tag, you must set it to a table of key-value pairs that contain the additional data that should be passed to plugins. See User tags for details. (V10.0)

identifier of the icon to save
destination file
optional: desired output icon format (defaults to #ICNFMT_HOLLYWOOD) (V9.0)
optional: table containing further arguments (V9.0)

Show TOC