Link to home
Start Free TrialLog in
Avatar of Hermy
Hermy

asked on

Drawing in a View window problem

Hello,

I want to draw in the View window of a MFC application. This can be done with LineTo, MoveTo, etc. Now when I want to draw a rect, that moves when my mouse moves, the old rects are still there. I can update de view window with pDoc->UpdateAllViews()  but this causes my application to crasch sometimes and the View window flickers with this 'animation'.

Is there another appraoch how  you can avoid this problem?

Herman
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vijay_visana
vijay_visana

first you store coordinates of rectangle drawn last time.
draw the rectangle with this coordinates but with background color and then draw
new rectangle with your forground color and save coordinates