Click here to Skip to main content
15,882,114 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to retain the drawn line while drawing another,while mouse move,as InvalidateRect() is repainting the window every time. PLZ Please Help me as soon as possible.
Posted
Updated 29-Nov-10 1:50am
v3

See the Scribble MFC sample[^].
cheers,
AR
 
Share this answer
 
Comments
ShivamShukla 30-Nov-10 0:59am    
Thanks for the answer,but It is a MDI application I am developing a SDI application
Alain Rist 30-Nov-10 2:06am    
There is no difference regarding your question, mouse and painting handling.
You can store the start and end points of previous lines and re-draw previous and new lines.
 
Share this answer
 
Comments
ShivamShukla 30-Nov-10 0:56am    
Thanks for the answer,but
How many times do i have to redraw it?
as now it is retaining 2 lines.
Invalidate() should only be called when the particular window needs to be redrawn. Maybe you're calling it when you shouldn't be called. In general, the paint routines will only be called when windows determines there's been a change to your drawing context area, either by a window being placed on top of yours then removed, or resizing, but if you're drawing layers or have controls that affect appearance, then that's when you'd invalidate certain portions.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900