A Bitmap File Analyzer: Pictures
The picture below shows an example of a paletted file; this happens to be the Windows NT logo. The colors and their palette values are shown in the listbox (which is in the background), and in the inset image (a modeless dialog box with a scrollable image window), the outline shows what part of the image is being examined. Keep in mind that the ListBox display is in file order, and the bitmap is stored in inverted order (bottom to top).
The image below shows another display; this is the part of the listbox that precedes the bitmap image. Here the BITMAPINFOHEADER information is displayed, and if there is a palette, the palette data is displayed. The modeless dialog box inset has been moved to a different location, and has been scrolled.
The next snapshot is of a 24-bit image. Note that the triples are delimited and shown in the composite RGB color represented by the three tuples. To make it evident which value is which, each number in the triple has a blue, green, or red line at the bottom to indicate its color component.
Since all images are padded to a multiple of 4 bytes in length on each line, this is shown by putting the last few bytes, if they are padding, separated by a large gap and shown with a gray backgroun. This appears in each style of image; here we see the effect on a 24-bit image that needed one byte of padding.
Here is a 1-bit image display. Here the program puts a gray delimiter gap between each byte. The bits in gray are the unused bits (note that a 1-bit image can occupy a partial byte).
Just for completeness, I show a 4-bit file. Note the delimiters between bytes, and the gray unused bytes at the end
Currently the program does not support 16-bit and 32-bit color images.
Just to prove it can print out, here's the first page of the printout of the above image. The second page contains the bitmap image.
The definition isn't very good on these scans because they were resampled and compressed so they would not take forever to download. The above image, for example, was scanned as an 18MB TIFF file. The one below was contrast-enhanced so the pattern shows a bit, even though it is greatly compressed from the 2.3MB TIFF it started as.
The views expressed in these essays are those of the author, and in no way represent, nor are they endorsed by, Microsoft.