CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Repaint only part of the client area

  1. #1
    Join Date
    Dec 2007
    Location
    France
    Posts
    322

    Repaint only part of the client area

    Is there a way to get only a part of the client area with GDI?

    Or do i need DirectX for this?

    I mean if i wanted to repaint only a little rectangle in the client area and
    leave the rest as it is.

  2. #2
    Join Date
    Jun 2005
    Posts
    1,255

    Smile Re: Repaint only part of the client area

    It is possible, e.g.

    - If you draw a rectangle, then your program can test the coordinates before issuing the Rectangle() API with coordinates inside your area.
    - It is the same for string of characters written with DrawText() or with TextOut().
    - If you have a picture, you can use BitBlt() only for the area you want to repaint.
    - Or you can use "regions". See http://msdn.microsoft.com/en-us/libr...84(VS.85).aspx

  3. #3
    Join Date
    Dec 2007
    Location
    France
    Posts
    322

    Re: Repaint only part of the client area

    Thank you Olivthill!

    I'll give it a try.

  4. #4
    Join Date
    Sep 2002
    Location
    14 39'19.65"N / 121 1'44.34"E
    Posts
    9,815

    Re: Repaint only part of the client area

    Quote Originally Posted by MasterDucky
    Is there a way to get only a part of the client area with GDI?

    I mean if i wanted to repaint only a little rectangle in the client area and
    leave the rest as it is.
    Sure - that's exactly what InvalidateRect() and InvalidateRgn() are for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)