Re: Obtaining HBitmap from HDC

Originally Posted by
Andonic
Thanks a lot. I have added the Bitblt and the new HDC and finally i have obtained the HBITMAP for the CStatic::SetBitmap function, so the refresh works well.
Only two more questions, why is neccesary other HDC? Is Bitblt really neccesary if i use SetBitmap? Well, thank you again :-) as i have said already works.
A DC obtained using GetDC() is a so called "window DC" because it draws directly onto a window. You should not select a bitmap into a window DC.
Instead you create a compatible DC. It will be called a "memory DC" after you have selected the bitmap into it because it then draws onto memory.
If your only goal is to obtain a bitmap for use with SetBitmap, BitBlt is not necessary. I got the impression that the bitmap should be drawn onto screen as well.
Nobody cares how it works as long as it works