Subj : Re: WM_PAINT or TWindow::Paint To : borland.public.cpp.borlandcpp From : maeder Date : Wed Aug 10 2005 09:14 am "MarvinAvery" writes: >> You should be able to use InvalidateRect() for the rectangles occupied >> by these lines. > > I can't use InvalidateRect() because the method doing the invalidating > doesn't know about these special lines. I see. >> BUT: I don't see the point of your question. What's the difference of >> painting N-1 characters over their own graphical representation? > > I am doing horizontal scrolling. My Paint() routine uses the scroll > positions to ascertain the characters to be painted. That is, it > paints characters, say, n to n+10. However some special lines are > not to be scrolled horizontally, thus characters 0 to 10 are always > painted. When scrolling, say, 1 character left, the *whole* window > gets moved and only the leftmost character gets painted. Thus, the > special lines get scrolled; I want to paint the entire line to > "unscroll" it. I know I could use Invalidate() but I would rather > use UpdateWindow() as it looks much nicer in action. The device context passed to the Paint() member function has a clipping region consisting of the invalidated rectangles. Apart from that, I think that it is compatible to the window dc or the client dc of the window. You could use one of these to write these lines to avoid clipping. > Now, to change the subject a little. Maybe you can help me here. I > am *very* confused about the following: What is a device context's > clipping region? Painting and writing and other similar operations to a dc only have an effect inside the clipping region. The TPaintDC class sets a paint dc's clipping region to the upate region of the window to be painted. > What is its update region? The union of all the places in a window that have been invalidated since the last WM_PAINT message was handled. > How do these relate to the TRect that is passed as a parameter to > TWindow::Paint()? This rectangle is obtained when BeginPaint() is called for the paint dc (by the TPaintDC constructor, I think). IIRC, it's the bounding box around the clipping region. [BTW: This thread would be more on topic over in the owl newsgroup; I didn't realize that when I first replied. It's probably too late for going there now, but please remember in future threads.] .