Using GetDIBits() for Retrieving Bitmap Information

ID: Q85846

The information in this article applies to:

SUMMARY

When saving a bitmap in .DIB file format, the GDI function is used to retrieve the bitmap information. The general use of this function and the techniques for saving a bitmap in .DIB format are largely unchanged; however, this article provides more details on the use of the Win32 API version of the GetDIBits() function.

MORE INFORMATION

The function can be used to retrieve the following information:

The fifth and the sixth parameters of the function are used to tell the graphics engine exactly what the application wants it to return. If the fifth parameter is NULL, then no bits will be returned. If the biBitCount is 0 (zero) in the sixth parameter, then no color table will be returned. In addition, the biSize field of the BitmapInfoHeader must be set to either the size of BitmapInfoHeader or BitmapCoreHeader for the function to work properly.

Refer to the SAVEBMP.C file in the MANDEL sample for details. This sample is included with the Win32 SDK.

Additional reference words: 3.10 3.50 4.00 95 KBCategory: kbgraphic KBSubcategory: GdiBmp

Last Reviewed: July 12, 1999