• 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: Drawing with a mask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing with a mask


  • Subject: Re: Drawing with a mask
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 15 Apr 2002 13:46:33 -0700

On Saturday, April 13, 2002, at 05:09 AM, David Remahl wrote:

Hi, all!

I want to draw an image based on a mask. What I mean is, I want to draw only
the parts of an image where its alpha and the mask alpha intersect. I have
tried all the different compositioning modes, and the one that is closest is
NSCompositeSourceIn, but that restricts the drawing of the source to the
alpha of the target but leaves the target visible. That is a problem if the
source image is smaller than the destination, as I don't want the
destination to show up.

What approach do you suggest that I take?

You can do this in more than one step, by creating a new NSImage that serves as a place to composite two images together, which you can then draw somewhere else.

-jcr


John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Drawing with a mask (From: David Remahl <email@hidden>)

  • Prev by Date: How to use NSUndoManager removeAllActionsForTarget:?
  • Next by Date: Re: NSFileManager and aliases
  • Previous by thread: Drawing with a mask
  • Next by thread: AppleEvents from Cocoa?
  • Index(es):
    • Date
    • Thread