Pergunta

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.

Foi útil?

Solução 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...

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top