Creating Icons for Specific Displays

Although the Icon Editor edits and saves a device-independent form of the icon, the Device menu enables you to create versions of the icon for specific display devices.

An independent form is automatically created when you create a new icon or pointer and all other forms are derived from it. If you select any of the other device forms listed in the menu, a new form is created for the specified device. The Custom option enables you to create an icon or pointer for any other device.

Select List to view a list of all existing forms, including custom and standard forms. Any item in this list can be selected and edited or deleted. However, you must have at least one device-independent form. Select Add in the list dialog to add a new device form.

Several icon bit maps can be saved in a single icon resource; when the icon is saved, all versions are saved with it in a format that includes a device resolution tag for each version. When the icon is loaded from a resource file, the display device resolution is matched against the device for which each device-dependent icon was intended. If a match is found, that icon is used. If no match is found, the application uses the device-independent icon, which always exists.

Figure files can contain any of the following forms to support multiple devices:

Device-dependent icons are those that are designed for a particular display resolution.

An application can display icons or bit maps in dialog boxes or windows.

The file-name extension depends on the type of resource you are creating. The Icon Editor produces a file with any of the following extensions:

The ICO, PTR, or BMP files must be referred to in the resource script file for your application. The external files containing icons, pointers, and bit maps are all referred to in the resource script file by single-line statements that have a similar format. For example:

ICON    ID_MAINWND myprog.ico   /* Icon    */
POINTER ID_PTR     mypoint.ptr  /* Pointer */

BITMAP  ID_BMP     mybtmp.bmp   /* bit map  */

ICON, POINTER, and BITMAP keywords identify the resource type.

The resource type is followed by a symbolic name or integer identifier that is used by your application to identify the resource. For example, with ICON, the ID_MAINWND identifier can be used by the application in the control data parameter of the WinCreateWindow call (or as a parameter to the WinCreateStdWindow call) that creates the frame of the main window of your application. The OS/2 operating system then associates the icon with the main window.

The symbolic name or identifier can be followed by any loading and memory options.

The last part of the statement is the file name and file type of the resource created by the Icon Editor. A fully qualified path name must be given if the file is not in the current directory. An icon that it used for a minimized application should have the same file name as the executable file of the application.


[Back: Filling Areas with Color]
[Next: Using a Command Line]