How to render to an "offscreen" CWnd
Posted on 2003-10-28
If I have a CWnd object that is either not visible or that is clipped on the screen by another window, if I try to get access to the CWnd's DC for the purpose of copying the CWnd's image data to a bitmap using StretchBlt(), the areas of the CWnd that are not actually drawn and visible on the screen appear in the result as either the other window or black.
Is there a way to, well, create an "offscreen window" - a full blown CWnd that has its own bitmap/screen data - such that if I draw stuff to it and then try to StretchBlt() from it, the data is intact, even if part or all of the window is not visible on the screen?
Any help would be greatly appreciated.