Reputation: 3775
I have written this program, but when I minimize the window, all the drawing will be cleared. what should I do?
CClientDC dc(this);
dc.Ellipse(point.x-20,point.y-20,point.x+20,point.y+20);
c[n][1] = point.x; c[n][2] = point.y;
who can help me solving this problem?
thanks alot
Upvotes: 1
Views: 361
Reputation: 3631
Make a function of your above code and call it from OnDraw
function. It will work fine.
Upvotes: 0
Reputation: 490148
Presumably you mean when you restore after having minimized the window.
Normally, in MFC you should do your drawing in the view's OnDraw
member function (so you almost never need to use CClientDC
as you have). Anything else that wants something drawn will put data describing what needs to be drawn into the Document object, and then call UpdateAllViews
to get the new data drawn.
Upvotes: 2