PARSEBIT.EXE Directly Accesses the Bits of a DIB Section

Last reviewed: December 5, 1996
Article ID: Q159649
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) for Windows NT & Win95, versions 3.51, 4.00

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

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().
    
    
You can download PARSEBIT.EXE from the Microsoft Software Library (MSL) on the following services:
  • Microsoft's World Wide Web Site on the Internet

          On the www.microsoft.com home page, click the Support icon.
          Click Knowledge Base, and select the product.
    
          Enter kbfile PARSEBIT.EXE (size: 48917 bytes) 
                                   , and click GO!
          Open the article, and click the button to download the file.
    
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the Softlib/Mslfiles folder.
          Get PARSEBIT.EXE (size: 48917 bytes) 
    
  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download PARSEBIT.EXE (size: 48917 bytes) 
    

For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online
               Services

REFERENCES

For more information on the structure of the various DIB formats, please see the following article in the Microsoft Knowledge Base:

   ARTICLE_ID: Q94326
   TITLE     : SAMPLE: 16 and 32 Bits-Per-Pel Bitmap Formats


KBCategory: kbprg kbgraphic kbfile kbhowto
KBSubcategory: GdiBmp
Additional reference words: 3.51 4.00 KbDSI



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 5, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.