Free Trial Software Downloads Command-line Resource Editor
Heaventools Home
 

home      products      solutions     news     downloads     order     support     about us

 

 
Resource Tuner Console Feature Tour
 

 

 prev | next 

Console Resource Editor

Any Batch Manipulation Of Icons Made Easy

If your build process involves replacing icon resources with icons from an .ico file, Resource Tuner Console is the solution! It supports any manipulation of multiple icons based on a specified criteria.

Icons are stored in .DLL and .EXE files in Icon Groups. Each Icon Group can contain multiple icon images, each with a different size and/or color depth. Common sizes include 16, 32, and 48 pixels square. Vista, the new version of Microsoft Windows, includes new PNG compressed 256×256 icons. Each icon should contain three color depths to support different monitor display settings. Color depths include 32-bit (24-bit with 8-bit alpha channel), 8-bit (256 colors) and 4-bit (16 colors).

From now on, you don't have to change icons manually. Resource Tuner Console provides many ways of batch editing multiple Icon entries at once in the IconGroups. You can specify whether to add a new icon, or replace an existing icon, or replace an existing icon only if there is an icon in the Icon Group that has the same width, height, and color depth as the icon specified, or replace an icon only with the specified language.

Let's get started with the Icon automation.

1. Write a simple script (see below)
2. Run Resource Tuner Console
3. You are done.

To see the changes made, we recommend using Resource Tuner GUI, a visual resource editor.

The Script Used

The following example uses the ChangeIcon procedure with the EditMode argument set to CREATE_IF_NOT_EXIST to find an English-US (LangID 1033) IconGroup and the main application icon. If the application has no icons, then an icon specified will be added. If the application has icons, the procedure will try to find an icon with the same size and color depth as the icon in .ico file. Once found, this icon will be replaced with the icon from the file specified. Otherwise, that icon from the file will be added to the IconGroup.

SrcLng = 0 'Neutral
ResourcesProxy.ChangeIcon "", SrcLng, CREATE_IF_NOT_EXIST, REPLACE_IF_ITEM_EXISTS, "c:\icons\icon_32x32x16.ico"

A description of the RTC script format and sample scripts can be found in the RTC Scripting Language Reference within the Resource Tuner Console package.

The next example creates a full XP icon set in the resources at once. The file "c:\icons\main_icons.ico" contains all 9 icon images in required pixel sizes and color depths as follows: 48x48x4b, 32x32x4b, 16x16x4b, 48x48x8b, 32x32x8b, 16x16x8b, 48x48x32b, 32x32x32b and 16x16x32b.

SrcLng = 0 'Neutral
ResourcesProxy.ChangeIcon "", SrcLng, CREATE_IF_NOT_EXIST, REPLACE_IF_ITEM_EXISTS, "c:\icons\main_icons.ico"

You can replace or add a 256x256 Vista Icon (a PNG-compressed icon) based on a specified criteria. See the sample code.

The next example does the same for the IconGroup with the name COOL_ICONS specified. This example creates an XP-compatible icon set (9 in total, with the right order - 4-bit first followed by 8-bit followed by 32-bit). This script is based on the Edit Icons sample script. It may be helpful to use this example as a template for your own scripts.

SrcLng = 0 'Neutral
ResourcesProxy.ChangeIcon "COOL_ICONS", SrcLng, CREATE_IF_NOT_EXIST, REPLACE_IF_ITEM_EXISTS, "c:\icons\icon_48x48x4.ico"
ResourcesProxy.ChangeIcon "COOL_ICONS", SrcLng, CREATE_IF_NOT_EXIST, REPLACE_IF_ITEM_EXISTS, "c:\icons\icon_32x32x4.ico"
ResourcesProxy.ChangeIcon "COOL_ICONS", SrcLng, CREATE_IF_NOT_EXIST, REPLACE_IF_ITEM_EXISTS, "c:\icons\icon_16x16x4.ico"
ResourcesProxy.ChangeIcon "COOL_ICONS", SrcLng, CREATE_IF_NOT_EXIST, REPLACE_IF_ITEM_EXISTS, "c:\icons\icon_48x48x8.ico"
ResourcesProxy.ChangeIcon "COOL_ICONS", SrcLng, CREATE_IF_NOT_EXIST, REPLACE_IF_ITEM_EXISTS, "c:\icons\icon_32x32x8.ico"
ResourcesProxy.ChangeIcon "COOL_ICONS", SrcLng, CREATE_IF_NOT_EXIST, REPLACE_IF_ITEM_EXISTS, "c:\icons\icon_16x16x8.ico"
ResourcesProxy.ChangeIcon "COOL_ICONS", SrcLng, CREATE_IF_NOT_EXIST, REPLACE_IF_ITEM_EXISTS, "c:\icons\icon_48x48x32.ico"
ResourcesProxy.ChangeIcon "COOL_ICONS", SrcLng, CREATE_IF_NOT_EXIST, REPLACE_IF_ITEM_EXISTS, "c:\icons\icon_32x32x32.ico"
ResourcesProxy.ChangeIcon "COOL_ICONS", SrcLng, CREATE_IF_NOT_EXIST, REPLACE_IF_ITEM_EXISTS, "c:\icons\icon_16x16x32.ico"

 See also FAQ: How to replace icons from a batch file

Feature Tour  
 prev | next 

 


Buy NowBuy Resource Tuner Console now for US$ 199, and make resource editing easier and faster.

Download a 30 day trial version of RTC     How to Order

     

Home  •   Site Map  •   Purchase  •   Downloads  •   Support  •   F.A.Q.  •   Forum  •   About