How to clip a CDC object?

VC6, Win98/NT

After drawing a region (with line, circle etc) to a CDC object, how can i clip the CDC object so that the final display on the View is a smaller rectangular region that i wanted.

I have looked some of the CDC clipping member functions but could not figure out how to use them.  

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Did you try CWnd::InvalidateRgn ?
or CWnd::InvalidateRect ?
 Have you tried the following:
  CRECT myViewRect;
  CRECT desiredRect;
   Then, from the rectangle, adjust it to the size you want and store in desiredRect.  Then call
You can just use
CDC::SelectClipRgn(CRgn* pRgn);
create rectangular region and select it

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leowlfAuthor Commented:
Thanks everyone.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.