> >   pilrc will take any depth bitmap and convert it to the correct
> >   depth :) i added that code a *long* time ago (maybe +1 year now)
> >   :P
> 
> Ok, say I want a 4 bit grayscale bitmap.  How do I save the file so that
> it is only 4 bit depth?

  you dont :)

> If I have to save it as a 16 color bitmap, which color indexes would be
> used for the 4 colors? Are you saying that if you have a bitmap family 
> that the bitmaps might be:
> 
> 1bmp, 4bmp, 4bmp, 8bmp and pilrc would convert the 2nd bitmap to 2 bit?
> If so, which colors are chosen for the 4 colors from the 16 in the
> original file?

  well, 16 grays will need to be saved as 256 color min.. 16 
  color bitmap doens't support 16 different grays :) it uses
  a VGA palette

  1bmp, 4bmp, 8bmp, 8bmp would work

  if you take a look at the pilrc sources, bitmap.c - you'll see
  this (the code is open source, go get it):

---
/*
 * The 1bit-2 color system palette for Palm Computing Devices.
 */
int PalmPalette1bpp[2][3] =
{
 { 255, 255, 255}, {   0,   0,   0 }
};

/*
 * The 2bit-4 color system palette for Palm Computing Devices.
 */
int PalmPalette2bpp[4][3] =
{
  { 255, 255, 255}, { 192, 192, 192}, { 128, 128, 128 }, {   0,   0,   0 }
};
....
---

  they are the palette definitions..  further on you'll see

----
....
   for (i = 0; i < dstPaletteSize; i++)
   {
     dstPalette[i][0] = PalmPalette4bpp[i][0];
     dstPalette[i][1] = PalmPalette4bpp[i][1];
     dstPalette[i][2] = PalmPalette4bpp[i][2];
   }
.....
   // whats the (r,g,b) tupile at the index?
   w = getBits(pbmi, dx, pbSrc, x, yT, 32, &a, &r, &g, &b);
   ...
   int v = BMP_RGBToColorIndex(r, g, b,
                               dstPalette,
                               dstPaletteSize);
----

  trust me.. pilrc does all the work :) try it :P

// az
[EMAIL PROTECTED]
http://www.ardiri.com/ 


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to