Click to See Complete Forum and Search --> : Create memory DC
balak yap
May 11th, 1999, 09:22 PM
How to create a memory DC which cannot be see but can paint as usual
DC? I check CreateCompatibleDC, it need a HDC which "shall" be show..(i try hide, but cannot work).
i try CreateDC("DISPLAY",NULL,NULL,NULL) but it paint into desktop,
i try CreateDC with all parameter NULL, i get nothing..
Ang idea?
Thanks
Thanks
Hello World!!!
Jason Teagle
May 12th, 1999, 03:18 AM
CreateCompatibleDC() IS a memory DC - although you pass it an existing DC, the existing DC could be an existing memory DC, or it can be a (visible) window DC - it does not matter. If you draw to the newly-created DC it will NOT be visible unless you BltBit() to the visible DC. All you are doing with the parameter to CreateCompatibleDC() is telling it HOW the DC should be created (what attributes to give it - colour planes, bits per pixel, etc.) - you are not actually making it visible like the original. It is safe to draw on it, and then BitBlt() it when ready to display it - this is how you can prepare the next frame in an animation before showing it.
You're right about CreateDC() - it actually creates a DC which represents, or more to the point IS, the device you created it for - hence with "DISPLAY", it is actually a channel to the screen itself, not a memory copy.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.