Science Fair Projects Ideas - XBM

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

XBM

XBM (X BitMap) is an ASCII monochrome image format used by the X Window System and is used for storing cursor and icon bitmaps that are used in the X GUI. XBM files are quite different from most image files in that they are actually C language source files that are created to be read by a C compiler rather than a graphical display program.

XBM data is typically found in headers (.h files) and are a series of static unsigned char arrays containing the monochrome pixel data. There is one array per image stored in the header.

As an example, the following piece of C code is an XBM file:

#define test_width 16
#define test_height 7
static char img_bits[] = {
0x13, 0x00, 0x15, 0x00, 0x93, 0xcd, 0x55, 0xa5, 0x93, 0xc5, 0x00, 0x80,
0x00, 0x60, };

which defines a 16x7 bitmap. You can see for yourself by creating a new text file, pasting in the C code above, and naming it blarg.xbm, then trying to view it in either your favourite image viewer or a web browser.

In place of the usual image file format header, XBM files have two or four #define statements. The first two #defines specify the height and width of the bitmap in pixels. The second two, if they exist, specify the position of the hotspot within the bitmap, and are not present if no hotspot is defined in the image. A hotspot within the image is used for bitmapped cursors to define where the "pointer" of the cursor is, generally at 0,0.

The image data is a line of pixel values stored in a static array. Because each pixel is only one bit in size (black or white), each byte in the array contains the information for eight pixels, with the first pixel in the bitmap represented by the high bit of the first byte in the array. If the image width is not a multiple of 8, the extra bits in the last byte of each row are not used and are discarded.

12-03-2008 10:22:39
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice