Day 164: Antialiasing

There is a note in MSDN which states that one should pass HDC that was used to create the memory device context to create a color bitmap. Otherwise, a monochrome bitmap is created because that is the initial format of a selected bitmap when a memory device context is created.

Note: When a memory device context is created, it initially has a 1-by-1 monochrome bitmap selected into it. If this memory device context is used in CreateCompatibleBitmap, the bitmap that is created is a monochrome bitmap. To create a color bitmap, use the HDC that was used to create the memory device context.

So to get antialiasing working one would just need to pass the device context of the screen (via GetDC(0)) as the first argument to CreateCompatibleBitmap.

Edited by Marius Adaškevičius on
Sweet! We'll try that and see if it gets our antialiasing back.

- Casey