Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / November 2004



Tip: Looking for answers? Try searching our database.

CGContextClipToRect() working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 28 Nov 2004 22:48 GMT
I do the following:
    CGContextClipToRect(contextRef, myCGRect);
where myCGRect = {(15,653), (757,15)};

Then, right after setting the clip, I get it to make sure it worked.
Here's the code

    CGRect clipCGRect = CGContextGetClipBoundingBox(contextRef);

and I get clipCGRect = {(inf, inf), (0,0)}

Any idea why this might not be working?  I can set clipping just fine
in other pieces of code.  Just not this one. Error codes would be nice
;)

BTW: I've also done a simple clip rect that was 15,15 and failed as
well.

Thanks,
-Mike
Eric VERGNAUD - 29 Nov 2004 10:17 GMT
dans l'article 4ec9206a.0411281448.6d294c0e@posting.google.com, Mike à
mikegarcia2000@yahoo.com a écrit le 28/11/04 23:48 :

> I do the following:
> CGContextClipToRect(contextRef, myCGRect);
[quoted text clipped - 16 lines]
> Thanks,
> -Mike

Obviously you know that CGContextClipToRect "Sets the clipping path to the
intersection of the current clipping path with the area defined by the
specified rectangle".

So if you call CGContextGetClipBoundingBox before calling
CGContextClipToRect, you'll probably find that clipCGRect is already null.

I wish we had a method to enlarge the clipping rect without saving the
context state.

Eric
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.