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

Thread: Wm_paint

Threaded View

  1. #1
    Join Date
    Feb 2005
    Location
    Pune (India)
    Posts
    644

    Thumbs up Wm_paint

    Hi,

    Thanks for looking in to this !

    I have my paint function,In Which I am calling Draw Method of Objects
    Code:
    OnPaint(CDC *pDC)
    {
    
    For(int i=0;i<Count;i++)
    {
      CShape *temp=GetShape(i);
      temp->Draw(pDC);
    }
    
    }
    and
    CShape as well as Derived classes implemented Draw() method.
    Code:
    CMyRect::Draw(CDC *pDC)
    {
      //Some Code
      //
      pDC->Rectangle(...);
    
    }
    
    CMyDate::Draw(CDC *pDC)
    {
      //Some Code
      pDC->.......
    
    }
    I want to ignore the draw code if it does'nt lies in invalidate region.

    Code:
    CMyDate::Draw(CDC *pDC)
    {
      if(InvalidateRgn Overlaps this object Rect)
     {
       //Some Code
      pDC->.......
     }
     else
     {
        //Ignore 
     }
    }
    How to do this ? Is there any API for getting invalidate region.
    How to get Update Rect Inside Paint() ? as its get cleared after beginpaint call !
    Thanks !
    -Anant
    Last edited by anantwakode; April 14th, 2007 at 05:33 AM.
    "Devise the simplest possible solution that solves the problems"

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured