I would like to create an in-memory device context that has a color depth that is not the same as the display device. However, I do not know an easy way to create device contexts other than using the CreateCompatibleDC function, which results in a device context with the same color depth as the display device.

Any ideas on how to accomplish this?