orezvani
orezvani

Reputation: 3775

Drawing will be cleared after minimizing window vc++ mfc

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

Answers (2)

Muhammad Ummar
Muhammad Ummar

Reputation: 3631

Make a function of your above code and call it from OnDraw function. It will work fine.

Upvotes: 0

Jerry Coffin
Jerry Coffin

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

Related Questions