# C++ biCompression for monochrome bitmaps



## drapp (Mar 1, 2009)

Hi all, hopefully something simple. 

I have a dll I'm playing with. The intent is to generate simple monochrome bitmap images. This is all direct C++, no C#. At present, I do GetDC() for the device context, GetCompatibleDC() to draw on, use FillRect() to fill appropriate areas, then write the BITMAPFILEHEADER, and BITMAPINFO and drawing bytes to a file, save, and works no problem.

Here IS the problem. The DC (device context) defaults to the screen and has resolution like 72dpi. I need to be able to change the resolution based on other possible devices and their resolution capacity via customized parameter values at later run-time, such as 203x203dpi, 300x300dpi, etc.

Through another utility that I don't understand, I can automate generating such BMP file, so I call it repeatedly with each pass being a given resolution, going from 1 to 300. Then compare the results, and I find the ONLY difference in the file header is that at the "biCompression" setting. So, I'm looking all over to how that is "computed", but can't find anything.

Help, and Thanks


----------

