Test code and operation result is as follows, expected results should only use a line, but the actual output 2 line, that is associated with a bitmap B of the code is not work, what is my way of thinking is the principle of closing, or other problems, in addition to this method, I can only think of "a" Graphics object associated with a bitmap, the great god: are there any other way?
CClientDC dc (this);//DC
Bitmap bmpA (500, 500);//bitmap A
Bitmap bmpB (100, 100);//bitmap B
Graphics gpDC (dc);//associated DC
Graphics gpMem (& amp; BmpA);//associated bitmap A
Pen newPen (Color (0, 255), 4);//brush set
GpMem. Clear (Color (255255255));//background color all white
GpMem. DrawLine (& amp; NewPen, 200, 200, 400, 400);//draw a diagonal line downwards
GpMem. FromImage (& amp; BmpB);//associated bitmap B invalid (why?)
GpMem. DrawLine (& amp; NewPen, 200, 200, 400, 0). Draw a line of oblique upward long//
GpDC. DrawImage (& amp; BmpA, 0, 0);//output to a window