"Fossies" - the Fresh Open Source Software Archive

Member "chandler-1.0.3/external/wx/wxPython-r218/docs/tech/tn0009.htm" (10 Oct 2007, 2174 Bytes) of package /windows/misc/Chandler_src_1.0.3.tar.gz:

Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted raw source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Creating and converting icons

Icons are bitmaps that may contain transparency information. Under X, icons are usually created from XPM files, which may be loaded from a file or created from data embedded in a C++ source file.

Under Windows, icon files (extension .ico) may contain multiple icons for different sizes and colour depths, and can be loaded from a file or loaded from the Windows resources compiled into the executable.

You can decide to use only XPMs on Windows and Unix, or you could use XPMs on Unix and Windows icons under Windows -- the latter will require some #ifdefs in your code or use of the wxICON macro.

If you are using a compiler such as Borland C++, Visual C++ or Watcom C++, you can use the provided icon editor. However, if using Cygwin or Mingw32, there is no icon editor so you must obtain one separately, such as IconEdit32.

To convert from XPM to BMP (which can be loaded or pasted into an icon editor to save as an ICO file), you can use Vadim Zeitlin's xpm2bmp.exe utility. To convert from BMP to XPM, you can use bmp2xpm.exe which is actually the old wxWidgets 1.68 utility, xpmshow. You will have to edit the resulting file since the full path is used as the variable name, plus you may wish to specify a transparent colour e.g.:

"  s None  c None",
This will indicate that the space character will be taken as the transparent colour throughout the image.