home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / help / resconv.txt < prev    next >
Encoding:
Text File  |  1995-11-24  |  12.5 KB  |  290 lines

  1. Resource Converter
  2.  
  3. Command Line Utility - ConvImage.Exe
  4.  
  5. The command line resource conversion utility, ConvImg.Exe, is designed to be used to in a non-interactive 
  6. way.  The utility can convert individual files or it can convert files contained within a specified directory.
  7.  
  8. General usage
  9.  
  10. convimg [-W | -O] [-D] [-H | -?] filein fileout
  11.  
  12. where    -W    Save as Windows resource (default)
  13.     -O    Save as OS/2 2.x resource
  14.     -D    Convert directory contents
  15.     -H    Display command line help
  16.     -?    Display command line help
  17.     filein    Input file (if -D used Input directory)
  18.     fileout    Output file (if -D used Output directory)
  19.  
  20.     (/ can be used in place of - and lower case characters can be used)
  21.  
  22. Single file conversion
  23.  
  24. When converting a single file, you need to specify the input filename and the output filename.  These 
  25. filenames need to be different from each other.  ConvImg.Exe will not allow you to convert a file and save it 
  26. on itself.  For example, to convert the file CORNER.BMP which is an OS/2 bitmap, you would use the utility 
  27. in the following manner:
  28.  
  29. convimg corner.bmp cornerw.bmp
  30.  
  31. or
  32.  
  33. convimg os2bmps\corner.bmp winbmps\corner.bmp
  34.  
  35. To convert a windows bitmap, RIVER.BMP, to OS/2, you would use the utility in the following fashion:
  36.  
  37. convimg -O river.bmp rivero.bmp
  38.  
  39. or
  40.  
  41. convimg -O winbmps\river.bmp os2bmps\river.bmp
  42.  
  43. Multiple file conversion
  44.  
  45. To convert an entire directory of bitmaps, cursors, icons or pointers, you would use the utility in the 
  46. following manner:
  47.  
  48. convimg os2bmps winbmps
  49.  
  50. The above example will cause the contents of the os2bmps directory  to be converted to corresponding 
  51. Windows formats in the winbmps directory.
  52.  
  53. When using this convert directory mode, it should be noted that the resources must have a .BMP, .CUR, 
  54. .ICO or .PTR extension otherwise the bitmap, cursor, icon or pointer resource will not be converted.  When 
  55. using the individual conversion mode, any valid filename can be used.
  56.  
  57. When you are converting OS/2 bitmaps to a Windows bitmap, and your OS/2 bitmap contains more than 
  58. one image (essentially different resolutions of the image in one bitmap file), the utility will only save the 
  59. first image.  This is due to the Windows bitmap format which only contains one resolution.  If you want to 
  60. convert the remaining resolutions, you should use the CONVERT.EXE utility which will allow you to view 
  61. each image contained within the bitmap and save each under a different name.
  62.  
  63.  
  64. GUI Utility - Convert.Exe
  65.  
  66. The command line resource conversion utility, Convert.Exe, is designed to be used to in a non-interactive 
  67. way.  The utility can convert individual files or it can convert files contained within a specified directory.
  68.  
  69. General usage
  70.  
  71. The Graphical User Interface version of the Resource Converter, Figure 1, is very easy to use.
  72.  
  73.  
  74.  
  75. Figure 1 - Resource Converter
  76.  
  77. It contains five action bar menu items:
  78.  
  79. Item    Usage
  80. File    Used to open a file to convert and to save selected images.
  81. Options    Used to define image types that should be pre-selected when Group mode is in 
  82. effect.
  83. Format    Used to select the desired output format:  OS/2 or Windows
  84. Mode    Used to select the save mode for resources that contain more than one image 
  85. resolution.
  86. Help    Used to select help.
  87.  
  88. The File action bar menu, Figure 2, contains two items:
  89.  
  90.  
  91.  
  92. Figure 2 - File menu
  93.  
  94. Item    Usage
  95. Open    Used to open a bitmap (.BMP), cursor (.CUR), icon (.ICO) or pointer (.PTR) file 
  96. to view and/or convert.
  97. Save    Used to save the images selected within the main application window.  The 
  98. save option will only be active if at least one filename has been specified when 
  99. saving individual items or when a filename and at least one item has been 
  100. selected when saving a group of items as a single file.
  101. Browse    Used to locate a file or directory which will be used as the filename for the 
  102. image associated with the entry field the cursor or caret is located.
  103. Exit    Used to exit the utility.
  104.  
  105. The Open File dialog, Figure 3, allows you to select a bitmap (.BMP), cursor (.CUR), icon (.ICO) or pointer 
  106. (.PTR) file to view within the Resource Converter main window.  You can then save the image or images in 
  107. OS/2 or Windows formats.
  108.  
  109. The upper area contains an entry field labeled Open filename.  You can enter within this entry field the file 
  110. you wish to open.  Also contained within the dialog is a Drive drop-down list and a Directory and File list 
  111. boxes.  Through the Drive drop-down, you can select a different drive to select files from.  Through the 
  112. Directory list box, you can select a different directory to select files from.  And finally, through the File list 
  113. box, you can select the file to view.
  114.  
  115. You can quickly select a file for viewing by double clicking the mouse pointer on the file within the File list 
  116. box.  Alternately, you can select the file within the File list box, upon which the name will be automatically 
  117. placed within the Open filename entry field.  You can then click the mouse pointer on the OK push button.  
  118. This will cause the file to be loaded and the images displayed within the Resource Converter main window.
  119.  
  120.  
  121.  
  122. Figure 3 - Open File dialogue
  123.  
  124. To aid you, you can press Ctrl+B to cause the Browse dialog, Figure 4, to be displayed.  The Browse dialog 
  125. allows you to select a bitmap (.BMP), cursor (.CUR), icon (.ICO) or pointer (.PTR) file to use within the 
  126. entry field that contains the cursor.
  127.  
  128. The dialog is divided into two areas.  The upper area contains an entry field labeled Filename to use.  Also 
  129. contained within this area is information on the current path, the volume label of the drive, the number of 
  130. bytes remaining of the drive and the number of bitmap (.BMP), cursor (.CUR), icon (.ICO) or pointer 
  131. (.PTR) files contained within the current directory.
  132.  
  133. Through the Drive drop-down, you can select a different drive to select files from.  Through the Directory list 
  134. box, you can select a different directory to select files from.  And finally, through the Files list box, you can 
  135. select the file to view.
  136.  
  137. You can quickly select a filename to use by double clicking the mouse pointer on the file within the File list 
  138. box.  Alternately, you can select the file within the File list box, upon which the name will be automatically 
  139. placed within the Filename to use entry field.  You can then click the mouse pointer on the OK push button.
  140.  
  141.  
  142.  
  143. Figure 4 - Browse dialogue
  144.  
  145. The Options action bar menu, Figure 5, contains one item:
  146.  
  147.  
  148.  
  149. Figure 5 - Options menu
  150.  
  151. Item    Usage
  152. Icon/cursor/pointer pre-selection    Used to define the image types that should be pre-selected when Group mode 
  153. is selected.
  154.  
  155. The Icon/Cursor/Pointer Pre-selection Options dialog, Figure 6, allows you to define which image types should 
  156. be pre-selected when a bitmap (only when OS/2 Format is selected), icon or cursor/pointer is opened and the 
  157. Mode is Group.  The Window image types that you can select from are:
  158.  
  159. Option    Target Device
  160. 32 x 16 - 2 colors    CGA 2 color.
  161. 32 x 32 - 2 colors    Monochrome 2 color.
  162. 16 x 16 - 16 colors    Small icon 16 color.
  163. 32 x 32 - 16 colors    EGA/VGA 16 color.
  164.  
  165. The OS/2 image types that you can select from are:
  166.  
  167. Option    Target Device
  168. 16 x 16 - 16 colors    Independent Small Color Form.
  169. 20 x 20 - 16 colors    XGA/8514 Small Color Form.
  170. 32 x 32 - 16 colors    Independent Color Form (=VGA).
  171. 40 x 40 - 16 colors    XGA/8514 - 16 colors.
  172. 64 x 64 - 16 colors    Independent Form - (1.2 format).
  173. 16 x 16 - 2 colors    Independent Small BW Form.
  174. 20 x 20 - 2 colors    XGA/8514 Small BW Form.
  175. 32 x 16 - 2 colors    CGA
  176. 32 x 32 - 2 colors    Independent BW Form (=1.1 format)
  177. 40 x 40 - 256 colors    8514
  178. 64 x 64 - 256 colors    8514 - (1.2 format).
  179.  
  180. Initially, each of the options will be selected.  This means that when an icon or cursor/pointer is displayed, 
  181. any formats that are matched will be selected.
  182.  
  183. When you deselect an image format, that particular format will not be pre-selected.  Any formats that are 
  184. not recognized within the list will be automatically selected.
  185.  
  186.  
  187.  
  188. Figure 6 - Icon/Cursor/Pointer Pre-selection Options dialog
  189.  
  190. These options also govern how the command line utility converts icons and cursor/pointers.  Items that are 
  191. selected through the Icon/Cursor/Pointer Pre-selection Options dialog will be converted and saved.  Items that 
  192. are recognized but not selected through the dialog will not be converted and saved.  Any items that are not 
  193. recognized (ie. New formats or special formats) will be converted and saved.
  194.  
  195. The Format action bar menu, Figure 7, contains two items:
  196.  
  197.  
  198.  
  199. Figure 7 - Format menu
  200.  
  201. Item    Usage
  202. OS/2    Used to cause the Resource Converter to save the final images in OS/2 2.x 
  203. format.
  204. Windows    Used to cause the Resource Converter to save the final images in Windows 
  205. format.  This is the default.
  206.  
  207. The Mode action bar menu, Figure 8, contains two items:
  208.  
  209.  
  210.  
  211. Figure 8 - Mode menu
  212.  
  213. Item    Usage
  214. Group    Used to cause the Resource Converter to display the images such that one 
  215. filename is used to save the images under.  The inclusion or exclusion of an 
  216. image is by selecting a checkbox.  Figure 10 depicts the Resource Converter in 
  217. Group mode.
  218. Items    Used to cause the Resource Converter to display the images such that each 
  219. image can be saved as individual files.  The inclusion or exclusion of an image 
  220. is by entering a filename in the entry field that immediately precedes the image.  
  221. Figure 9 depicts the Resource Converter in Items mode.
  222.  
  223. When in Group mode, the name of the converted file is entered within the entry field located above the 
  224. images and labeled Save to.  Beside each image is a check box which indicates the size of the image and the 
  225. number of colors.  When the file is first displayed, each check box item will be pre-selected.  To exclude an 
  226. image from the final converted file, you simply uncheck the check box of the image you donÆt want to 
  227. include.
  228.  
  229. The name of the final converted file should be entered within the entry field above the images.  You will not 
  230. be able to save the converted images until you enter a filename in the entry field and at least one of the 
  231. check boxes is checked.
  232.  
  233.  
  234.  
  235. Figure 9 - Resource Converter in Group mode
  236.  
  237. When in Items mode, the name of the converted file is entered within the entry field preceding each of the 
  238. images.  Beside each image is the size of the image and the number of colors.  Only those images that 
  239. contain a filename within the entry field will be saved.  Each of the converted images will be saved using 
  240. the name contained in the entry field preceding the image..
  241.  
  242. You will not be able to save the converted images until you enter and filename in the entry field and at least 
  243. one of the check boxes is checked.
  244.  
  245.  
  246.  
  247. Figure 10 - Resource Converter in Items mode
  248.  
  249. The Help action bar menu, Figure 11, contains five items:
  250.  
  251.  
  252.  
  253. Figure 11 - Help menu
  254.  
  255. Item    Usage
  256. Help index    Used to display the help index.
  257. General help    Used to display the general help for the utility.
  258. Using help    Used to display the help on using the help.
  259. Keys help    Used to display the help for keys.
  260. Product information    Used to display the product information dialogue which contains the utility 
  261. version number and copyright notice.
  262.  
  263. You can use the following accelerator keys:
  264.  
  265. Accelerator    Action
  266. Ctrl+B    Display Browse dialog
  267. Ctrl+G    Select Group Mode
  268. Ctrl+I    Select Item Mode
  269. Ctrl+O    Display Open File dialog
  270. Ctrl+P    Display Icon/Cursor/Pointer Pre-selection Options dialog
  271. Ctrl+S    Save image or images
  272. Ctrl+W    Select Windows Format
  273. Ctrl+2    Select OS/2 Format
  274.  
  275. Conversion Considerations
  276.  
  277. If you are using the Borland Resource Workshop, you will likely see color table shifts where Resource 
  278. Workshop will override the colour table contained within the bitmap, icon or cursor.  To make sure that you 
  279. have the correct colors being used with the image, select the Options action bar and the Editor options menu 
  280. item.  Make sure that the option Save with default device colors is not selected.  When this option is selected, 
  281. Resource Workshop will always use its default color table and will override the image color table.
  282.  
  283. There are situations where a cursor image will not appear correctly.  This is due to the selection of the 
  284. background color of the image editor that you are using.  For example, if you have used a red color in the 
  285. original icon or cursor, and the image editor uses red as denoting the background colour, your icon or 
  286. cursor will appear to have ignored the image.  You much exercise care when converting since this is up to 
  287. the image editing tool you use.  You may have to change the original image such that the particular color is 
  288. different thereby insuring that the final converted image is what you expected.
  289.  
  290.