Resource Converter

Command Line Utility - ConvImage.Exe

The command line resource conversion utility, ConvImg.Exe, is designed to be used to in a non-interactive 
way.  The utility can convert individual files or it can convert files contained within a specified directory.

General usage

convimg [-W | -O] [-D] [-H | -?] filein fileout

where	-W	Save as Windows resource (default)
	-O	Save as OS/2 2.x resource
	-D	Convert directory contents
	-H	Display command line help
	-?	Display command line help
	filein	Input file (if -D used Input directory)
	fileout	Output file (if -D used Output directory)

	(/ can be used in place of - and lower case characters can be used)

Single file conversion

When converting a single file, you need to specify the input filename and the output filename.  These 
filenames need to be different from each other.  ConvImg.Exe will not allow you to convert a file and save it 
on itself.  For example, to convert the file CORNER.BMP which is an OS/2 bitmap, you would use the utility 
in the following manner:

convimg corner.bmp cornerw.bmp

or

convimg os2bmps\corner.bmp winbmps\corner.bmp

To convert a windows bitmap, RIVER.BMP, to OS/2, you would use the utility in the following fashion:

convimg -O river.bmp rivero.bmp

or

convimg -O winbmps\river.bmp os2bmps\river.bmp

Multiple file conversion

To convert an entire directory of bitmaps, cursors, icons or pointers, you would use the utility in the 
following manner:

convimg os2bmps winbmps

The above example will cause the contents of the os2bmps directory  to be converted to corresponding 
Windows formats in the winbmps directory.

When using this convert directory mode, it should be noted that the resources must have a .BMP, .CUR, 
.ICO or .PTR extension otherwise the bitmap, cursor, icon or pointer resource will not be converted.  When 
using the individual conversion mode, any valid filename can be used.

When you are converting OS/2 bitmaps to a Windows bitmap, and your OS/2 bitmap contains more than 
one image (essentially different resolutions of the image in one bitmap file), the utility will only save the 
first image.  This is due to the Windows bitmap format which only contains one resolution.  If you want to 
convert the remaining resolutions, you should use the CONVERT.EXE utility which will allow you to view 
each image contained within the bitmap and save each under a different name.


GUI Utility - Convert.Exe

The command line resource conversion utility, Convert.Exe, is designed to be used to in a non-interactive 
way.  The utility can convert individual files or it can convert files contained within a specified directory.

General usage

The Graphical User Interface version of the Resource Converter, Figure 1, is very easy to use.

 

Figure 1 - Resource Converter

It contains five action bar menu items:

Item	Usage
File	Used to open a file to convert and to save selected images.
Options	Used to define image types that should be pre-selected when Group mode is in 
effect.
Format	Used to select the desired output format:  OS/2 or Windows
Mode	Used to select the save mode for resources that contain more than one image 
resolution.
Help	Used to select help.

The File action bar menu, Figure 2, contains two items:

 

Figure 2 - File menu

Item	Usage
Open	Used to open a bitmap (.BMP), cursor (.CUR), icon (.ICO) or pointer (.PTR) file 
to view and/or convert.
Save	Used to save the images selected within the main application window.  The 
save option will only be active if at least one filename has been specified when 
saving individual items or when a filename and at least one item has been 
selected when saving a group of items as a single file.
Browse	Used to locate a file or directory which will be used as the filename for the 
image associated with the entry field the cursor or caret is located.
Exit	Used to exit the utility.

The Open File dialog, Figure 3, allows you to select a bitmap (.BMP), cursor (.CUR), icon (.ICO) or pointer 
(.PTR) file to view within the Resource Converter main window.  You can then save the image or images in 
OS/2 or Windows formats.

The upper area contains an entry field labeled Open filename.  You can enter within this entry field the file 
you wish to open.  Also contained within the dialog is a Drive drop-down list and a Directory and File list 
boxes.  Through the Drive drop-down, you can select a different drive to select files from.  Through the 
Directory list box, you can select a different directory to select files from.  And finally, through the File list 
box, you can select the file to view.

You can quickly select a file for viewing by double clicking the mouse pointer on the file within the File list 
box.  Alternately, you can select the file within the File list box, upon which the name will be automatically 
placed within the Open filename entry field.  You can then click the mouse pointer on the OK push button.  
This will cause the file to be loaded and the images displayed within the Resource Converter main window.

 

Figure 3 - Open File dialogue

To aid you, you can press Ctrl+B to cause the Browse dialog, Figure 4, to be displayed.  The Browse dialog 
allows you to select a bitmap (.BMP), cursor (.CUR), icon (.ICO) or pointer (.PTR) file to use within the 
entry field that contains the cursor.

The dialog is divided into two areas.  The upper area contains an entry field labeled Filename to use.  Also 
contained within this area is information on the current path, the volume label of the drive, the number of 
bytes remaining of the drive and the number of bitmap (.BMP), cursor (.CUR), icon (.ICO) or pointer 
(.PTR) files contained within the current directory.

Through the Drive drop-down, you can select a different drive to select files from.  Through the Directory list 
box, you can select a different directory to select files from.  And finally, through the Files list box, you can 
select the file to view.

You can quickly select a filename to use by double clicking the mouse pointer on the file within the File list 
box.  Alternately, you can select the file within the File list box, upon which the name will be automatically 
placed within the Filename to use entry field.  You can then click the mouse pointer on the OK push button.

 

Figure 4 - Browse dialogue

The Options action bar menu, Figure 5, contains one item:

 

Figure 5 - Options menu

Item	Usage
Icon/cursor/pointer pre-selection	Used to define the image types that should be pre-selected when Group mode 
is selected.

The Icon/Cursor/Pointer Pre-selection Options dialog, Figure 6, allows you to define which image types should 
be pre-selected when a bitmap (only when OS/2 Format is selected), icon or cursor/pointer is opened and the 
Mode is Group.  The Window image types that you can select from are:

Option	Target Device
32 x 16 - 2 colors	CGA 2 color.
32 x 32 - 2 colors	Monochrome 2 color.
16 x 16 - 16 colors	Small icon 16 color.
32 x 32 - 16 colors	EGA/VGA 16 color.

The OS/2 image types that you can select from are:

Option	Target Device
16 x 16 - 16 colors	Independent Small Color Form.
20 x 20 - 16 colors	XGA/8514 Small Color Form.
32 x 32 - 16 colors	Independent Color Form (=VGA).
40 x 40 - 16 colors	XGA/8514 - 16 colors.
64 x 64 - 16 colors	Independent Form - (1.2 format).
16 x 16 - 2 colors	Independent Small BW Form.
20 x 20 - 2 colors	XGA/8514 Small BW Form.
32 x 16 - 2 colors	CGA
32 x 32 - 2 colors	Independent BW Form (=1.1 format)
40 x 40 - 256 colors	8514
64 x 64 - 256 colors	8514 - (1.2 format).

Initially, each of the options will be selected.  This means that when an icon or cursor/pointer is displayed, 
any formats that are matched will be selected.

When you deselect an image format, that particular format will not be pre-selected.  Any formats that are 
not recognized within the list will be automatically selected.

 

Figure 6 - Icon/Cursor/Pointer Pre-selection Options dialog

These options also govern how the command line utility converts icons and cursor/pointers.  Items that are 
selected through the Icon/Cursor/Pointer Pre-selection Options dialog will be converted and saved.  Items that 
are recognized but not selected through the dialog will not be converted and saved.  Any items that are not 
recognized (ie. New formats or special formats) will be converted and saved.

The Format action bar menu, Figure 7, contains two items:

 

Figure 7 - Format menu

Item	Usage
OS/2	Used to cause the Resource Converter to save the final images in OS/2 2.x 
format.
Windows	Used to cause the Resource Converter to save the final images in Windows 
format.  This is the default.

The Mode action bar menu, Figure 8, contains two items:

 

Figure 8 - Mode menu

Item	Usage
Group	Used to cause the Resource Converter to display the images such that one 
filename is used to save the images under.  The inclusion or exclusion of an 
image is by selecting a checkbox.  Figure 10 depicts the Resource Converter in 
Group mode.
Items	Used to cause the Resource Converter to display the images such that each 
image can be saved as individual files.  The inclusion or exclusion of an image 
is by entering a filename in the entry field that immediately precedes the image.  
Figure 9 depicts the Resource Converter in Items mode.

When in Group mode, the name of the converted file is entered within the entry field located above the 
images and labeled Save to.  Beside each image is a check box which indicates the size of the image and the 
number of colors.  When the file is first displayed, each check box item will be pre-selected.  To exclude an 
image from the final converted file, you simply uncheck the check box of the image you dont want to 
include.

The name of the final converted file should be entered within the entry field above the images.  You will not 
be able to save the converted images until you enter a filename in the entry field and at least one of the 
check boxes is checked.

 

Figure 9 - Resource Converter in Group mode

When in Items mode, the name of the converted file is entered within the entry field preceding each of the 
images.  Beside each image is the size of the image and the number of colors.  Only those images that 
contain a filename within the entry field will be saved.  Each of the converted images will be saved using 
the name contained in the entry field preceding the image..

You will not be able to save the converted images until you enter and filename in the entry field and at least 
one of the check boxes is checked.

 

Figure 10 - Resource Converter in Items mode

The Help action bar menu, Figure 11, contains five items:

 

Figure 11 - Help menu

Item	Usage
Help index	Used to display the help index.
General help	Used to display the general help for the utility.
Using help	Used to display the help on using the help.
Keys help	Used to display the help for keys.
Product information	Used to display the product information dialogue which contains the utility 
version number and copyright notice.

You can use the following accelerator keys:

Accelerator	Action
Ctrl+B	Display Browse dialog
Ctrl+G	Select Group Mode
Ctrl+I	Select Item Mode
Ctrl+O	Display Open File dialog
Ctrl+P	Display Icon/Cursor/Pointer Pre-selection Options dialog
Ctrl+S	Save image or images
Ctrl+W	Select Windows Format
Ctrl+2	Select OS/2 Format

Conversion Considerations

If you are using the Borland Resource Workshop, you will likely see color table shifts where Resource 
Workshop will override the colour table contained within the bitmap, icon or cursor.  To make sure that you 
have the correct colors being used with the image, select the Options action bar and the Editor options menu 
item.  Make sure that the option Save with default device colors is not selected.  When this option is selected, 
Resource Workshop will always use its default color table and will override the image color table.

There are situations where a cursor image will not appear correctly.  This is due to the selection of the 
background color of the image editor that you are using.  For example, if you have used a red color in the 
original icon or cursor, and the image editor uses red as denoting the background colour, your icon or 
cursor will appear to have ignored the image.  You much exercise care when converting since this is up to 
the image editing tool you use.  You may have to change the original image such that the particular color is 
different thereby insuring that the final converted image is what you expected.

