IFF To Icon Translator
For The Amiga
Charles L. Baker
Design your own Workbench icons using programs such as Deluxe Paint, Aegis Images, and Graphicraft.
"IFF to Icon" lets you customize your Workbench icons by translating IFF image files into Workbench info files. IFF (Interchange File Format) is a standard file structure developed jointly by Electronic Arts and Commodore-Amiga. Most commercial drawing programs for the Amiga store images according to the IFF standards.
In order for a file's icon to appear on the Workbench screen, there must be a corresponding info file. The Preferences program, for example, has the Preferences.info file associated with it. Drawers, the Trashcan (a special type of drawer), and even disks use info files to describe what their icons look like. By modifying info files, we can redefine Workbench icons.
Creating An Image
Before you can use this program, you must create an image file with Deluxe Paint or any other IFF-compatible program. This article will describe what you must do when using Deluxe Paint; other programs use a similar process. Once you have created the image file, you can run IFF to Icon to convert your image into a Workbench icon.
Before you create the image, set the drawing program to the type of screen which your Workbench uses—either medium-resolution or high-resolution (interlace). The icon's colors are ultimately determined by the Workbench and not the drawing program used to design the icon. You may use the Preferences program to change the Workbench colors. Remember that the Workbench only uses four colors.
After you have drawn the desired image, it must be saved as a brush. To select an image as a brush within Deluxe Paint, click the left mouse button on the brush-selection tool and drag a selection box around the image. To save a brush file, select Save or Save As from the Brush menu.
Exit the drawing program. At this point, the image has been saved as a brush file on disk. To minimize disk swapping, you should copy the brush file to your BASIC work disk.
Type in and save IFF to Icon. The program uses the system library file named icon.bmap. In order for Amiga Basic to use this library, it must have a file description of the library in a form which it understands. This form is called a bmap file. The bmap file is essentially a list of pointers that allow Amiga Basic to access library routines.
The file icon.bmap must be created before you can run IFF to Icon. If you have version 1.2 of the Amiga operating system (available as an inexpensive upgrade from any Amiga dealer), you can create icon.bmap quite easily. The BASIC-Demos disk for 1.2 contains a BASIC program named ConvertFd, as well as a directory named FD1.2. Run the ConvertFd program and enter the following information when prompted:
Enter name of .fd file to read > Amiga Extras:fd1.2/icon-lib.fd Enter name of .bmap file to produce > icon.bmap
When the ConvertFd program is finished, the disk contains the icon.bmap file. Copy this file onto the same disk as the IFF to Icon program. When IFF to Icon is run, the icon.bmap file must be either in the current directory or in the directory named LIBS (LIBrarieS) on the disk used when you booted the system. The LIBS directory is a good place for bmap files, since their purpose is to give you access to libraries. If you don't have the bmap files in the correct place, BASIC will stop with a file not found error when you run IFF to Icon.
Using The Program
Run IFF to Icon. The program asks you to enter the name of the IFF file to translate and the name of the info file to modify. You must specify the disk and folder in which the programs are located. Do not include the info extension when entering the second filename. The program does this for you. If you wish to change the trashcan's icon, for example, simply enter the filename TRASHCAN. The IFF to Icon program does not create new info files; it modifies existing ones. So, the info file must already exist on disk.
After both filenames have been entered, IFF to Icon translates the IFF image, creates a temporary image file of its own, and finally modifies the specified info file. To convert IFF image files, this program uses code from the "IFF Translator" program published in the April 1987 issue.
Even after modification, a file's original icon will stay on the Work-bench screen until the file, drawer, or disk is closed and redrawn. For files and drawers, this means closing and reopening the window that the icon is located in. If you modified a disk's icon, you must close all drawers and windows from the disk, remove the disk from the drive, and reinsert the disk after the original icon has disappeared. In some cases, you may have to reboot in order to remove the original disk icon from the Workbench screen.