On Thu, Sep 14, 2000 at 11:52:43AM +0200, Shay wrote:
> i'm very sorry for my mixup.
> what i want is to gnerate an image with some popolar graphic tool (PSP,
> PhotoShop ...), save it in the PC as a windows BMP file, and then take it to
> my PC application, which cut the header from the file, and transfer the
> image data to the palm.
> so i need to generate the right file size in the PC,
> which mean 1 bit color = X byte, 2 bit color = 2X byte, 4 bit color = 4X
> byte
> i looked at the graphic tools, and i saw they all can make 1/4/8 bit color
> file (with the right number of bytes),
> and i need also the 2 bit color file (with 2X byte size).
> so i asked if there any, and i learned that windows can't support it,
> than i asked if anyone knows how the bytes are arranged in the image file,
> so i could take a 4 bit color BMP file with 2 bit colors in it, and remove
> the unused bytes in my application.

Sorry about my erroneous response on the other question, but Aaron had
the correct answer.

http://www.wotsit.org/ has three entries for the BMP format.  Mainly
it is a header, an image geometry prefix, a palette, then image data.
They also have entries for most other graphic formats.

In a 4bpp, each nybble contains a color index, but should only have 4
palette entries (at least 4 used entries, so you may have to prescan).

They don't have to be the same, so you may get a stream in hex like

13 8b 11 3b 3b 88

where each hex digit represents one pixel.  You can build a lookup
table our use some other method to translate 1/3/8/b, or whatever 4
color indicies are used to 0/1/2/3 and pack them 4 per byte.


-- 
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