I guess I do understand what happens if I select "an object" into a "device contect", and if this object is a brush, font, pen: The charactersicts of these objects are hence forth used for the drawing onto the device context.
However, I don't understand what happens after I select a bitmap into the device context, much less, why it is necessary to do so.
I have a program that somehwere does
HDC dc = ::GetDC(hWnd);
ffBitmap = ::CreateCompatibleBitmap(dc, windowWidth, windowHeight);
ffMemoryDc = ::CreateCompatibleDC(dc);
hOldBitmap = (HBITMAP) ::SelectObject(ffMemoryDc, ffBitmap);
and later draws unto the ffMemoryDc and then *BitBlt*s the ffMemoyDc into the real device context of a window.
BitBlt ( dc,
0, 0, windowWidth, windowHeight,
ffMemoryDc,
0, 0,
SRCCOPY
);
The variable ffBitmap is referenced nowhere else in the entire program, yet, if I don't SelectObject(ffBitmap), nothing is drawn, so it is necessary.
I'd appreciate if someone could shed some light what happens here.