leowlf
asked on
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.
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.
Have you tried the following:
CRECT myViewRect;
CRECT desiredRect;
pDC->GetClipBox(&myViewRec t);
Then, from the rectangle, adjust it to the size you want and store in desiredRect. Then call
pDC->IntersectClipRect(&de siredRect) ;
Glenn
CRECT myViewRect;
CRECT desiredRect;
pDC->GetClipBox(&myViewRec
Then, from the rectangle, adjust it to the size you want and store in desiredRect. Then call
pDC->IntersectClipRect(&de
Glenn
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks everyone.
or CWnd::InvalidateRect ?