Bitmap file format

Hi

I need to write a program to display an image on a LCD and would like to find out the format of a bitmap file. The image that I want to send has 1 bit depth (Black and white).

The part that I dont understand is when it gets to the data of the bitmap.

Here is the hex data of a 5x4 pixel image:

0000: 42 4D 4E 00 00 00 00 00 00 00 3E 00 00 00 28 00
0010: 00 00 05 00 00 00 04 00 00 00 01 00 01 00 00 00
0020: 00 00 10 00 00 00 C4 0E 00 00 C4 0E 00 00 00 00
0030: 00 00 00 00 00 00 00 00 00 00 FF FF FF 00 00 00
0040: 00 00 00 00 00 00 00 00 00 00 C8 00 00 00

What i dont understand is how I can then plot the image with the given data. They say if the image has only two colors a byte represents 8 pixels and I am given 16 bytes of image data (16*8 = 128 pixels).

Do you know how i can then plot the image with the given data?

Thanks


Comments

  • : Hi
    :
    : I need to write a program to display an image on a LCD and would like to find out the format of a bitmap file. The image that I want to send has 1 bit depth (Black and white).
    :
    : The part that I dont understand is when it gets to the data of the bitmap.
    :
    : Here is the hex data of a 5x4 pixel image:
    :
    : 0000: 42 4D 4E 00 00 00 00 00 00 00 3E 00 00 00 28 00
    : 0010: 00 00 05 00 00 00 04 00 00 00 01 00 01 00 00 00
    : 0020: 00 00 10 00 00 00 C4 0E 00 00 C4 0E 00 00 00 00
    : 0030: 00 00 00 00 00 00 00 00 00 00 FF FF FF 00 00 00
    : 0040: 00 00 00 00 00 00 00 00 00 00 C8 00 00 00
    :
    : What i dont understand is how I can then plot the image with the given data. They say if the image has only two colors a byte represents 8 pixels and I am given 16 bytes of image data (16*8 = 128 pixels).
    :
    : Do you know how i can then plot the image with the given data?
    :
    : Thanks
    :
    :
    :
    Why don't you use the javax.imageio.ImageReader class. That can read BMP's and immediately give you access to the image contents, without you needing to write the code to read the file format itself. More info: http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/ImageReader.html
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion