PARSEBIT.exe Directly Accesses the Bits of DIB Section

ID: Q159649


The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API), used with:
    • Microsoft Windows 95
    • Microsoft Windows NT, versions 3.51, 4.0
  • Microsoft Windows 2000


SUMMARY

PARSEBIT demonstrates how to programmatically parse through the bits of DIB sections by performing a conversion from a hi/true color DIB section to an 8 bpp DIB section. Directly manipulating the bits of a DIB section can be very useful in situations where using Windows GDI to manipulate the bits is too slow.


MORE INFORMATION

The following file is available for download from the Microsoft Download Center. Click the file name below to download the file:

Parsebit.exe
For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

After you build the sample, run it, and then load a large BMP file. Once the file is loaded into a DIB section, you have two options for displaying it: use the Windows GDI to convert it via a BitBlt() or use the code in the sample to convert it. Both of these options can be selected from the "Display" menu. After you make your selection, the program will time how long it takes to display the bitmap using the selected method. On Windows 95, the difference between the two methods will be minimal because Windows 95 uses a similar optimization. However, on Windows NT, you'll probably find that the code in the sample is quite a bit faster than the BitBlt() provided by the OS.

The following files are a part of the PARSEBIT sample:
  • Palette.h Palette.C - Contains all of the functions relating to creating and manipulating Windows palettes.


  • DIB.h DIB.c - Contains all of the code for loading and converting DIBs and DDBs


  • FastBlt.h FastBlt.c - Contains the code for converting between high/true color and 8 bit per pixel DIB sections by walking the bits.


  • FastDemo.c - Provides a simple demonstration of the functionality provided by the code in FastBlt().


Additional query words:

Keywords : kbfile kbgraphic kbNTOS351 kbNTOS400 kbWinOS2000 kbSDKWin32 kbWinOS95 kbDSupport kbGDIFAQ
Version : WINDOWS:; winnt:3.51,4.0
Platform : WINDOWS winnt
Issue type : kbinfo


Last Reviewed: December 20, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.