Re: CALayer contentScale initialization, where to do it?
Re: CALayer contentScale initialization, where to do it?
- Subject: Re: CALayer contentScale initialization, where to do it?
- From: Kyle Sluder <email@hidden>
- Date: Sat, 16 Jun 2012 14:59:20 -0700
On Jun 16, 2012, at 1:53 PM, Markus Spoettl <email@hidden> wrote:
> On 6/16/12 8:08 PM, Kyle Sluder wrote:
>>> I usually create the layers (if there's a fixed number of them) in the
>>> view's -initWithFrame:. At that point the view doesn't have a window, so I
>>> can't set contentScale correctly (by getting the window's
>>> backingScaleFactor).
>>
>> Is this strategy documented somewhere? The High-Resolution Guide says to
>> avoid looking at the windows backingScaleFactor at all, but it's very sparse
>> on details about supporting CALayer.
>
> https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Introduction/Introduction.html
That's the same document I was referring to. But it also contains this very useful section, titled "Manage Core Animation Layer Contents And Scale": https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW27
Specifically, it looks like you want to implement -layer:shouldInheritContentsScale:fromWindow: on your layer delegates.
--Kyle Sluder
_______________________________________________
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