This article was previously published under Q139165
This article has been archived. It is offered "as is" and will no longer be updated.
When you create and use a memory Device Context (DC) to draw and store GDIimages, the bitmap displayed when transferred from the memory devicecontext to the physical display is monochrome. All colors are converted toeither black or white.
When creating a compatible bitmap for the memory DC, the handle to thememory DC is used as the first parameter to the call toCreateCompatibleBitmap(). This create a monochrome bitmap because amemory DC created with CreateCompatibleDC() is given a 1x1 monochrome bitmap as its default bitmap.
For example, the following code creates a monochrome bitmap and selects itinto a memory DC: