Clear text from a device context.
-
Your code works for me. In OnTimer(), I had to change
InvalidateRect(rTextRect);
toInvalidateRect(&rTextRect);
MarkMark Salsbery Microsoft MVP - Visual C++ :java:
-
Mark Salsbery wrote:
Your code works for me.
Really??? :wtf: I have tried both but I still get the smudge either way (I have only tested on XP).
Yes, really :) The change I made wasn't even necessary, since CRect has a LPRECT operator. I'm testing on Vista. Is it leaving a trail of pixels or does the entire text get left behind on previous draws? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Yes, really :) The change I made wasn't even necessary, since CRect has a LPRECT operator. I'm testing on Vista. Is it leaving a trail of pixels or does the entire text get left behind on previous draws? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
The entire text gets left behind (in the image below I have used 'rTextRect.OffsetRect(0, 20);' to space them out a bit to show this). http://i19.tinypic.com/8a4gh2w.jpg Thanks MS.
-
The entire text gets left behind (in the image below I have used 'rTextRect.OffsetRect(0, 20);' to space them out a bit to show this). http://i19.tinypic.com/8a4gh2w.jpg Thanks MS.
Hmm that shouldn't happen :) WM_ERASEBKGND should redraw the background for the invalidated rect when the CPaintDC is created (during the internal call to BeginPaint(). Can you add a WM_ERASEBKGND that calls the base class method? Then in that handler, maybe draw a rectangle at the textrect. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: