• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSBezierPath compositing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSBezierPath compositing (From: Simon Bovet <email@hidden>)

  • Prev by Date: help with archiving bug, a head-scratcher
  • Next by Date: Re: Self-scheduling threading
  • Previous by thread: Re: NSBezierPath compositing
  • Next by thread: Re: NSBezierPath compositing
  • Index(es):
    • Date
    • Thread