Compaq Visual Fortran: A Guide to Creating Windows Applications

10.4: Device-independent bitmaps

10.4 Device-independent bitmaps

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.

Table 10.3: Device-Independent Bitmap Format

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...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Graphics Software
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.