views:

235

answers:

1

I have googled around and not seen any info. What format and icon color depths are used for applications?

+3  A: 

The Palm OS icon format is a variation of it's bitmap format. Palm OS supports a concept called bitmap families where multiple bitmaps of different color depths and pixel densities are bundled together, with the appropriate one chosen at runtime. An icon is just a bitmap stored in a 'tAIN' resource as part of the application. Bitmaps also can be compressed using either RLE or PackBits, an algorithm used in the original Mac OS.

If you're using a tool like PilRC to compile your bitmaps, you should be sure to include a low density and a high density bitmap. Here's a sample icon definition that I've used in one of my own programs:

ICON
BEGIN
BITMAP "LargeSXSW06Icon_1bpp_72ppi__22x22.bmp" BPP 1 DENSITY 72
BITMAP "LargeSXSW06Icon_1bpp_144ppi_44x44.bmp" BPP 1 DENSITY 144
BITMAP "LargeSXSWIcon_8bpp_108ppi_33x33.bmp"   BPP 8 COMPRESS TRANSPARENTINDEX 0 DENSITY 108
BITMAP "LargeSXSWIcon_8bpp_144ppi_44x44.bmp"   BPP 8 COMPRESS TRANSPARENTINDEX 0 DENSITY 144
END

SMALLICON
BEGIN
BITMAP "SmallIcon_1bpp_72ppi_15x9.bmp"       BPP 1 DENSITY 72
BITMAP "SmallIcon_8bpp_72ppi_15x9.bmp"       BPP 8 DENSITY 72
BITMAP "SmallSXSWIcon_8bpp_108ppi23x14.bmp"  BPP 8 DENSITY 108
BITMAP "SmallSXSWIcon_8bpp_144ppi_30x18.bmp" BPP 8 DENSITY 144
END

I define two icons -- the standard large icon and a small icon that's used in the launcher in list view mode. The sizes are 22x22/44x44 for low and high density for the main icon, and 15x9/30x18 for the small icon. PilRC takes BMP files as input, but it outputs either .bin files for each resource or a combined PRC-format file with all the resources specified. The PilRC source code is the best reference to the actual binary format of the bitmap.

Ben Combee