Re: NSBezierPath compositing
Re: NSBezierPath compositing
- Subject: Re: NSBezierPath compositing
- From: "John C. Randolph" <email@hidden>
- Date: Wed, 16 Mar 2005 14:25:43 -0800
On Mar 9, 2005, at 6:05 AM, Simon Bovet wrote:
Is there a way to change the composite operation for a -
[NSBezierPath fill] ? I actually want to erase a non-rectangular
portion of an NSImage.
For rectangular areas, I can of course use:
[myImage lockFocus];
[[NSColor clearColor] set];
NSRectFill(myRect);
/* or
NSRectFillUsingOperation(myRect, NSCompositeCopy); */
[myImage unlockFocus];
What if I want to erase an arbitrary Bezier path? [myBezierPath
fill] won't do anything since it is always using the
NSCompositeSourceOver operation...
For Panther and earlier, you can do it the way I did in the "Cropped
Image" sample, at:
http://developer.apple.com/samplecode/Cropped_Image/Cropped_Image.html
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden