Spec for Windows BMP?

Spec for Windows BMP?

Post by Matthew Clar » Thu, 16 Jul 1998 04:00:00



Does anyone know where I can find the specs for Windows BMPs?
I need to be able to read/write one in an application.  Book or web
site would do nicely.  Thanks.

Matt Clark

 
 
 

Spec for Windows BMP?

Post by David La » Thu, 16 Jul 1998 04:00:00


: Does anyone know where I can find the specs for Windows BMPs?
: I need to be able to read/write one in an application.  Book or web
: site would do nicely.  Thanks.

BMP is not one format but several. There are Windows 3.x, 95 and NT
 versions, as well as older Windows and OS/2 versions also. Some of the
differences are very minor, others are not. If your application does not
correctly detect and handle different versions it may 'break' when it
encounters one of the others.

I found this reference to very useful (but expensive):
   Murray, James D. Encyclopedia of graphics file formats. 2nd ed. Bonn;
       Sebastapol, CA: O'Reilly & Associates. 1996.

David

 
 
 

Spec for Windows BMP?

Post by Joe Crawfo » Thu, 16 Jul 1998 04:00:00



> Does anyone know where I can find the specs for Windows BMPs?
> I need to be able to read/write one in an application.  Book or web
> site would do nicely.  Thanks.

There's a book called "Graphics File Formats" you can look for it on Amazon.com

But from the comp.graphics faq:
ftp://rtfm.mit.edu/pub/usenet/news.answers/graphics/fileformats-faq/p...

===============================================================================

Subject: BMP - Windows Bitmap Format

         Type: Bitmap
    Extension: BMP
      Version:
  Compression: RLE
  Color Depth: 1- to 24-bit
   Maintainer: Microsoft Corporation
Specification:

BMP is the native bitmap file format of the Microsoft Windows environment.
It efficiently stores mapped or unmapped RGB graphics data with pixels 1-,
4-, 8-, or 24-bits in size. Data may be stored raw or compressed using a
4-bit or 8-bit RLE data compression algorithm. BMP is an excellent choice
for a simple bitmap format which supports a wide range of RGB image data.

There is not single document that is the official &quotBMP Format
Specification&quot.
Instead, BMP information is spread over several programming references. You
can search the Microsoft Developers Network CD-ROMs and the Microsoft Knowledge
Base (available at ftp://ftp.microsoft.com/ and
http://www.microsoft.com/), but your
best source of BMP information lies outside of Microsoft and within the
following
references:

  Inside Windows File Formats, Tom Swan, Sams Publishing 1993.
    ISBN 0-672-30338-8 $24.95 softcover, 337 pages and 1 disk (3.5
in.).              
    Order: Sams Publishing, 2201 West 103rd Street, Indianapolis,
    IN 46290

  Luse, Marv. "The BMP File Format," Dr. Dobb's Journal, #219 September
    1994 (Vol 9, Issue 10), pp. 18-22.

  The BMP File Format: Part I, Dr. Dobb's Journal, David Charlap, #228
    March 1995 (Vol. 20, Issue 3).

  The BMP File Format: Part II, Dr. Dobb's Journal, David Charlap, #229
    April 1995 (Vol. 20, Issue 4).

The code for the above issues are available at:

  ftp://ftp.mv.com/pub/ddj/1994/1994.09/bmp.zip
  ftp://ftp.mv.com/pub/ddj/1995/1995.03/bmp.zip

Also have a look at:

  http://www.r2m.com/windev/
    Internet Resources for Windows Developers

And look in the OS/2 Developer Connection SDK for OS/2 BMP information.

===============================================================================

That should help you quite a bit.

Joe "there is a light that never goes out" Crawford

Joe Crawford  > ArtLung = Artist + Respiratory Therapist <
              >          W e b    D e s i g n e r        <
              >       Los Angeles, California, USA       <

              >   <http://home.earthlink.net/~artlung/>  <

 
 
 

Spec for Windows BMP?

Post by Yick Yan La » Sun, 02 Aug 1998 04:00:00



> Does anyone know where I can find the specs for Windows BMPs?
> I need to be able to read/write one in an application.  Book or web
> site would do nicely.  Thanks.

> Matt Clark

Dear Sir,
        I dont have the specification for bmp.
        But there is another quite well know file format, especailly for C
programmer, called X-bitmap. It is in the following format:
#define width ...
#define height ...
static char bits[] {
.....
Quote:};

You can save it in as an text file like 1.xbm , and open it in netscape,
or any other common web browser.
Unforutnately it supports only blak and whites picture.
There is also something very similar to xbm and is called xpm
it supports 16million colors. It is very similary to xbm.
Also there are converter to convert this to any format you like:
(searh for disp188a and display188b  in http://www.ftpsearch.com)

I have written some informal steps to convert a bitmap to xbm manually
but I thinks it is easy to write this as an computer program.
  suppose I want to generate a 17*3 , b&w bitmap as follow:
   012345678901234567
  ********************
  *  +              +* 0
  *    +         +   * 1
  *                  * 2
  ********************
  step 1) write every line in binary, group every 8 pixels. Please note
          each line must be multiple of 8 pixels, so in this case,
          althogh there is 17 pixels, we must fill it to 24 pixels by
          filling the rest with 1.
          line 0 in binary is (0010 0000) (0000 0000) (1111 1111)
          line 1 in binary is (0000 1000) (0000 0100) (0111 1111)
          line 2 in binary is (0000 0000) (0000 0000) (0111 1111)
  step 2) Reverse the bits in every 8 pixels groups, so result is:
          line 0 in binary is (0000 0100) (0000 0000) (1111 1111)
          line 1 in binary is (0001 0000) (0010 0000) (1111 1110)
          line 2 in binary is (0000 0000) (0000 0000) (1111 1110)
  step 3) change all that to hexidecimal:
          line 0 in hex.   is (0 4) (0 0) (f f)
          line 1 in hex.   is (1 0) (2 0) (f e)
          line 3 in hex.   is (0 0) (0 0) (f e)
  step 4) write the bitmap:
          #define  width 17
          #define  height 3
          static char bits[] = {
             0x04, 0x00, 0xff, 0x10, 0x20, 0xfe, 0x00, 0x00, 0xfe
          };
  step 5) You can cut above 5 lines and paste in 1.xbm
          and use netscape or internet explorer to view this file.
  This method was used to generate the pixels in the tweener program
  written in Java which can be find in my homepage:

   http://www-personal.usyd.edu.au/~ylam/PROGRAM/TWEENER/index1.html

Yick Yan Lam

 
 
 

1. Looking For BMP (Windows) File Format Spec

Hi.

I'm looking for a resource that describes the layout of a Windows BMP file
in detail. There are several such sources available on the Net, but the
basic assumptin seems to be that one will be dealing with the data from C,
and tend to describe the structures in terms of the Windows API etc.

I'm writting an IRC script, for a client that support the display of simple
bmps with text, and wish to be able to alter bmps colours on the fly, and
thought this might relatively simple by altering the bmp files colour
table.

These bmps will be 2 - 4 colour, 13 x 13, so there shouldn't be alot of
data to parse.

Any pointers to suitable resources would be appreciated, as would any
advice on what offsets hold the colour table, or indeed the feasability of
altering the pixel map.

Replies by E-mail would be most helpful, as my Usenet feed seems to be less
than consistent.

Regards,

 - Numen

 - http://www.users.dircon.co.uk/~toltec/

2. PS Conversion Needed

3. need spec for bmp file

4. triangles or n-sided polys ?

5. NEEDED: BMP file spec (Pascal)

6. Type Engine Won't Show New Fonts? In 5

7. Where can I find GIF, PCX, PIC and BMP format spec and decoding files

8. need spec for bmp file

9. NEED: BMP File spec (Pascal)

10. File spec for .BMP?

11. Windows Animated cursor spec?

12. MS Windows printer drivers written to your spec.