INF: Printing Monochrome and Color Bitmaps from Windows

ID Number: Q64520

3.00 3.10

WINDOWS

Summary:

The format of a display bitmap determines the procedure that an

application uses to print it. The two display bitmap formats available

under Windows are device-dependent bitmaps (DDBs) and device-

independent bitmaps (DIBs). DIBs and DIB functions should be used to

print color bitmaps.

An application can use the BitBlt or StretchBlt function to print or

display a monochrome bitmap. Both printer drivers and display drivers

can process monochrome DDBs. However, an application must account for

the difference in resolution between a typical display and a typical

laser printer. The StretchBlt function enables an application to

appropriately change the size of a monochrome bitmap.

When the display bitmap is a color DDB, printing is more difficult

because the display DDB format may not match the printer DDB format.

Because Windows supports a wide variety of devices, this situation is

quite common. When the formats DDB differ, the application must

convert the display DDB into a print DDB or a DIB.

DIBs are designed to ease the process of transferring images between

devices. When an application uses a DIB, GDI or the output driver

performs any conversions required for the device. The SHOWDIB sample

application, provided in versions 3.0 and 3.1 of the Microsoft Windows

Software Development Kit (SDK), demonstrates converting a DDB to a DIB

and other common manipulations. The file DIB.C is of particular

interest. It contains the functions that perform the manipulations.

This code can be incorporated into other applications. Version 3.1 of

the Windows SDK also includes the DIBVIEW application, which

demonstrates similar techniques.

Additional reference words: 3.00 3.10