• 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: Punching a hole in an NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Punching a hole in an NSImage


  • Subject: Re: Punching a hole in an NSImage
  • From: Scott Thompson <email@hidden>
  • Date: Thu, 2 Mar 2006 19:44:09 -0600


On Mar 2, 2006, at 8:51 AM, Guy English wrote:

This will make a transparent hole in your image:

[image lockFocus];
[[NSColor clearColor] set];
NSRectFill( rectOfHoleThroughImage );
[image unlockFocus];

Hope that helps,
Guy

This won't work. It will just draw a transparent rectangle on top of the existing image. (i.e. it will have no effect)


Instead you should use:

NSRectFillUsingOperation(rectOfHoleThroughImage, NSCompositeClear);

This should area in the box.

Scott


_______________________________________________ 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: 
 >Punching a hole in an NSImage (From: Ben Lachman <email@hidden>)
 >Re: Punching a hole in an NSImage (From: "Guy English" <email@hidden>)

  • Prev by Date: Re: Transparent window
  • Next by Date: Re: Eval() ?
  • Previous by thread: Re: Punching a hole in an NSImage
  • Next by thread: Re: Trouble with passing variables
  • Index(es):
    • Date
    • Thread