tags:

views:

26

answers:

2

I want to ask you one question about SDI MFC application. How can I repaint some area (region) on the view in SDI MFC application but without repaint complete view?

A: 

Have a look at the Invalidate functionality. You can invalidate a rectangle, a region or the while window.

An invalidated region will be repainted with the next WM_PAINT message. In your OnPaint() method you can query the clipping region from the CDC object. If the object in question is not withing the region/rectangle, you can skip drawing it.

mxp
+1  A: 

Use ::InvalidateRect() and/or CWnd::InvalidateRect().

Roel