Microsoft KB Archive/159649

{|
 * width="100%"|

PARSEBIT.exe Directly Accesses the Bits of DIB Section

 * }

Q159649

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * Microsoft Windows 95
 * Microsoft Windows NT Server versions 3.51, 4.0
 * Microsoft Windows NT Workstation versions 3.51, 4.0
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Professional

-

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:

"Parsebit.exe" For additional information about how to download Microsoft Support files, click the article number below to view the article in the Microsoft Knowledge Base:

"Q119591 How to Obtain Microsoft Support Files from Online Services" Microsoft used the most current virus detection software available on the date of posting to scan this file for viruses. Once posted, the file is housed on secure servers that prevent any unauthorized changes to the file.

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: Parsebit

Keywords : kbfile kbgraphic kbOSWinNT351 kbOSWinNT400 kbOSWin2000 kbSDKWin32 kbOSWin95 kbDSupport kbGDIFAQ

Issue type : kbinfo

Technology : kbAudDeveloper kbWin32sSearch kbWin32API