Help on SelectObject() function...
I'm struggling to understand the use of this function... Here's an example code
Code:
HDC hMemDC;
HBITMAP hBmp, hOldBmp;
hBmp = Earth.GetHandle ();
// Draw a line through the graphic file
hMemDC = CreateCompatibleDC(0);
hOldBmp = SelectObject (hMemDC, hBmp);
MoveTo (hMemDC, 0, 20);
LineTo (hMemDC, 30, 50);
SelectObject (hMemDC, hOldBmp);
DeleteDC (hMemDC);
// Show changes
Earth.Repaint ();
}
SelectObject() is used twice, but i fail to understand the use of it.. The code draws a line through an Earth object (Bitmap)...