I write a simple drawing ellipse program, I want to implement draw different outline ellipse, but my code doesn't work well with the line color, here's part of my code(part of WM_PAINT in WndProc funciton):
when I omit the line in the for loop, it works well when LBUTTONDOWN and MOUSEMOVE, but if I uncomment these, it got weired, all ellipse becomes the last drawing color, what should I do?
I got puzzle with SelectObject function, I want to know what the SelectObject do ? why first we save the return, and next we don't need the return value?
it works well when use like this:
// save the Ellipse in the class gShape, and use the class method, the method use the same code as before.
if( gMouseDown )
gShape->draw(hdc);
// Draw all the permenent shapes.
for(inti = 0; i < gShapes.size(); ++i)
gShapes[i]->draw(hdc);