On Mon, Mar 20, 2000 at 09:51:07PM -0800, Steve Sabram wrote:
> Mike,
>
> You need to create a file that describes the byte fields of the icon. It is
>typically called "smallicon.r" and you just include it
> right below the resource file in your project. The five lines below is all that
>there are in the file. This is an example of it.
>
> data 'tAIB' (1001) {
> $"0F00 0900 0200 0000 0000 0000 0000 0000"
> $"7FFC 4004 5224 5574 5824 5004 5FF4 4004"
> $"7FFC"
> };
>
> The first line of eight, 16-bit hex codes is for the resource compiler and don't
>change. The last nine, 16-bit hex codes describes
> the small icon structure. The first word represents the top row of the small icon.
>The MSB of each word represents the leftmost
> bit in the row of that word going to the right. The LSB of the word is ignored
>since the small icons are only 15 bits.
>
> The bad news: I ended up drawing a grid, filling in the squares and calculating the
>hex codes myself. There may be shareware now
> out there to help you since I did this over a year ago. If not, anyone who wants to
>write it, I'll beta yesterday.
>
> Steve
Usage: txt2bmp <icon.txt >tAIB03e9.bin
Actually it will do any size bitmap. Check the headers for format info
#include <stdio.h>
main()
{
unsigned int w, h, r, a1, a2, a3, a4, a5;
unsigned char row[256], o;
int i, j;
gets(row);
sscanf(row,"%d %d %d %d %d %d %d %d", &w, &h, &r, &a1, &a2, &a3, &a4, &a5);
putchar(w >> 8);
putchar(w);
putchar(h >> 8);
putchar(h);
putchar(r >> 8);
putchar(r);
putchar(a1 >> 8);
putchar(a1);
putchar(a2 >> 8);
putchar(a2);
putchar(a3 >> 8);
putchar(a3);
putchar(a4 >> 8);
putchar(a4);
putchar(a5 >> 8);
putchar(a5);
while (h--) {
memset(row,0,w);
gets(row);
for (i = 0; i < r; i++) {
for (o = 0, j = 7; j >= 0; j--)
o |= (row[i * 8 + 7 - j] & 1) << j;
putchar(o);
}
}
}
--------cut here-----
15 9 2 0 0 0 0 0
###############.
#.............#.
#.............#.
#.............#.
#.............#.
#.............#.
#.............#.
#.............#.
###############.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html