Compaq Visual Fortran: A Guide to Creating Windows Applications

The device-independent bitmap (DIB) is not a Win32 object; it does not have a handle, and it is not created by GDI functions. It is a file format that is used to describe an image contained in memory or disk. Table 10.3 provides an outline of the DIB file formats used for disk and memory images.
| Disk File Format Contains: | Memory Format Contains: |
|---|---|
| File header | ************* |
| Information header | Information header |
| Color table (optional) | Color table (optional) |
| Bitmap pixel data | Bitmap pixel data |
When a DIB is in memory, pointers to that DIB are used as arguments to the functions displaying the DIB. However, you can also convert a DIB into a DDB, as we did in BitView2, or into a DIB section. DIB sections permit DIB images to be treated as GDI objects with handles and, more importantly, as objects that can be drawn on in memory. The BitBlt and StretchBlt functions can be used with DIB sections but not with a DIB. DIB sections are not covered in this book, but they are very useful for anyone working with DIB bitmaps. The information covered in this chapter should equip interested readers with the background knowledge required for an independent study of DIB sections. A good starting place would be to look up the online information for DIBSECTION and follow the links.
The information given in Table 10.3 may at first appear to be a bit of an academic exercise, but we...