
Algorithm Alley - Dr Dobb's Journal - September 1993
"Diving into Windows Bitmaps: Part Two"
(c) 1993 by Tom Swan. All rights reserved.

Note: You may use any of the files in this ZIP file to create
your own compiled programs, which you may distribute free of any
charge or royalty.

Files ending in .CPP are sample programs written in Borland C++.
Files ending in .PAS are for Borland Pascal for Windows. Here's an
inventory of the files included in this month's upload:

    create.cpp      Creates fake sample bitmap file
    compare.cpp     Compares fake sample bitmap files
    monte.bat       Runs Monte Carlo test
    bpack.cpp       Compresses 256-color Windows bitmap files
    ubitmap.pas     BPW bitmap unit
    mdibits.pas     BPW bitmap viewer
    mdibits.rc      Resource script file
    mdibits.res     Compiled resource file for MDIBITS

Note: UBITMAP.PAS and MDIBITS.PAS are from my book, Borland Pascal
7.0 Programming for Windows, 1993, Bantam Books. The corrected files
fix a bug that prevented the program from loading compressed bitmaps.

To use CREATE, COMPARE, and MONTE, you also need the TPACK and
TUNPACK programs from last month. Run the MONTE.BAT file to run the
complete test suite. Press Crtl+C to end.

Compile BPACK.CPP with Borland C++, and use the program to compress
any 256-color Windows bitmap file. For example, to compress the file
MYBITS.BMP, enter the DOS command BPACK MYBITS.BMP PACKED.BMP.

Compile MDIBITS.PAS with Borland Pascal for Windows, and use the
program to view packed bitmap files. Unfortunately, Microsoft's
Paintbrush program does not recognize compressed bitmaps. However,
most Windows display drivers should be able to display compressed
images directly using MDIBITS.PAS or a similar utility. 

For more information about the files, see my column "Algorithm Alley"
appearing regularly in Dr. Dobb's Journal. Enjoy!

Tom Swan
Compuserve ID 73627,3241
