Name
APPICON -- declare application icon (V4.7)
Synopsis
@APPICON table
@APPICON f$     (V8.0)
Function
This preprocessor command can be used to specify an icon for your application. On Windows, macOS, and Linux this icon will appear in the window's border and in several elements of the window manager like the task bar. On AmigaOS 4, the icon will appear in AmiDock if your script runs as a registered AmigaOS 4 application. The icon you specify here will also be linked into the applets and executables you compile with Hollywood. By default, executables compiled by Hollywood will always use the standard Hollywood icon (the clapperboard). If you prefer to use your own icon instead, use this preprocessor command.

Starting with Hollywood 8.0 there are two different ways of using this preprocessor command: You can either specify individual images for the different icon sizes in a table (see below) or you can simply pass a Hollywood icon that has been created using the SaveIcon() function to this preprocessor command. In that case, the icon has to be passed in the f$ parameter. Specifying a single icon instead of a whole table results in code that is more readable but of course it requires you to generate the icon using Hollywood's SaveIcon() command first.

If you want to pass individual images for the different icon sizes, you have to pass a table in the table argument to this preprocessor command. The table can contain one or more of the following tags:

Ic16x16:
Custom icon in the resolution of 16x16 pixels.

Ic16x16s:
Selected state icon for size 16x16. (V6.0)

Ic24x24:
Custom icon in the resolution of 24x24 pixels.

Ic24x24s:
Selected state icon for size 24x24. (V6.0)

Ic32x32:
Custom icon in the resolution of 32x32 pixels.

Ic32x32s:
Selected state icon for size 32x32. (V6.0)

Ic48x48:
Custom icon in the resolution of 48x48 pixels.

Ic48x48s:
Selected state icon for size 48x48. (V6.0)

Ic64x64:
Custom icon in the resolution of 64x64 pixels.

Ic64x64s:
Selected state icon for size 64x64. (V6.0)

Ic96x96:
Custom icon in the resolution of 96x96 pixels.

Ic96x96s:
Selected state icon for size 96x96. (V6.0)

Ic128x128:
Custom icon in the resolution of 128x128 pixels.

Ic128x128s:
Selected state icon for size 128x128. (V6.0)

Ic256x256:
Custom icon in the resolution of 256x256 pixels.

Ic256x256s:
Selected state icon for size 256x256. (V6.0)

Ic512x512:
Custom icon in the resolution of 512x512 pixels.

Ic512x512s:
Selected state icon for size 512x512. (V6.0)

Ic1024x1024:
Custom icon in the resolution of 1024x1024 pixels. (V7.0)

Ic1024x1024s:
Selected state icon for size 1024x1024. (V7.0)

DefaultIcon:
This tag lets you specify which icon should be the default icon. You need to pass a string here that describes an icon size from the sizes listed above, e.g. "64x64" designates the icon specified in the Ic64x64 tag as the default icon. The default icon is the icon that Hollywood will show in AmiDock on AmigaOS4 if the RegisterApplication tag in @OPTIONS has been set to True. Thus, currently, the DefaultIcon tag only has an effect on AmigaOS 4. (V6.0)

The reason why this preprocessor command does not simply accept just a single 512x512 icon and then scales it down to all other resolutions is that very small icons like 16x16 or 24x24 do not really look very good when scaled down from a larger icon. They look much better when they are handcrafted for each size. That is why this preprocessor command accepts so many different tags.

Please note that not all sizes are currently supported on all platforms but you should make sure to provide icons for all these sizes. If you leave a size out, Hollywood might fall back to its default icon (clapperboard) for the size. So if you intend to use your own icons, make sure that you always provide it in all sizes listed above.

The image file that is required as a parameter by the tags listed above should be a PNG image with alpha channel. Images without alpha channel are supported as well, but this is not recommended because it doesn't look too good.

Please note that it is mandatory to use the DefaultIcon tag on AmigaOS 4 to indicate which icon size should be shown in AmiDock. If you do not pass the DefaultIcon tag, Hollywood will display its default icon in AmiDock (the clapperboard). If you want to show an icon in AmiDock that uses a custom size not listed above, you can use the DockyBrush tag that is supported by the @OPTIONS preprocessor command. See OPTIONS for details. Please note that Hollywood supports two different docky types on AmigaOS 4: Standard dockies and app dockies. See AmiDock information for more information on the difference between the two.

Starting with Hollywood 6.0 you can specify two images for every icon size because on AmigaOS and compatibles icons usually contain two different states whereas on all other platforms icons are just single static images. If you only target non-Amiga systems, you do not have to provide icons for the selected state because they won't be used anyway.

Alternatively, you can also use one of the -iconXXX console arguments instead of @APPICON.

Note that this preprocessor command currently does not have any effect on Amiga systems. If you would like to change the icon that Hollywood displays when it is minimized on Workbench, use the SetWBIcon() command.

Inputs
f$
name of a Hollywood icon OR
table
table containing one or more of the supported tags (see above)
Example
@APPICON "icon.png"
The code above sets the icon "icon.png" as the icon for the application. This icon must have been created using SaveIcon().


@APPICON {Ic16x16 = "my16x16icon.png",
Ic24x24 = "my24x24icon.png",
Ic32x32 = "my32x32icon.png",
Ic48x48 = "my48x48icon.png",
Ic64x64 = "my64x64icon.png",
Ic96x96 = "my96x96icon.png",
Ic128x128 = "my128x128icon.png",
Ic256x256 = "my256x256icon.png",
Ic512x512 = "my512x512icon.png",
Ic1024x1024 = "my1024x1024icon.png"}
The code above will replace all inbuilt icons with custom ones provided in the specified png images.

Show TOC