Re: Drawing an NSImage in a CALayer
Re: Drawing an NSImage in a CALayer
- Subject: Re: Drawing an NSImage in a CALayer
- From: Brad Gibbs <email@hidden>
- Date: Thu, 18 Sep 2008 15:33:43 -0700
The PNG is in the main bundle -- in my Resources folder.
On Sep 18, 2008, at 3:16 PM, David Duncan wrote:
On Sep 18, 2008, at 2:54 PM, Brad Gibbs wrote:
I'm trying to draw an NSImage (a PNG) in a CALayer. The goal is to
create a method that allows me to pass an NSImage as an argument to
create a layer-hosting view. I have:
Where is this PNG originating? The answer may mean a simpler (and
potentially faster) method can be used...
[imageLayer drawLayer:imageLayer inContext:ctx];
You don't call this function yourself. You set the delegate on the
CALayer and you implement this method. When the CALayer needs image
content it will be called automatically with the correct parameters.
This is usually as a result of a -display message being sent to the
layer (which is typically arranged for by sending -setNeedsDisplay).
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden