For now, I define the three CRect area on the dialog, and then I paint a ID on it with textout function, per CRect for One ID, and I want to use OnLButtonDown, OnMouseMove, and OnLButtonUp the record my mouse cursor and when mouse move the ID will repaint with the cursor.

I try to use Invalidate, but the screen will flash, I try to use InvalidateRect, but the item will repaint more and more times on screen.

How do I do it ? Have any example.

有帮助吗?

解决方案 2

well, I got the solution is use return true in OnEraseBkgnd function,

to remove flash screen problem. For now I can use invalidate(true) to repaint

my item which draw in rect...

其他提示

When you use InvalidateRect, you need to call it twice - once in the old location where you need to erase, and once in the new location where you need to paint. It's OK if the two overlap or even are identical.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top