Re: Punching a hole in an NSImage
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