Re: Can an image be "rejected" by CALayer?
Re: Can an image be "rejected" by CALayer?
- Subject: Re: Can an image be "rejected" by CALayer?
- From: Matt Neuburg <email@hidden>
- Date: Sun, 10 Apr 2011 19:50:59 -0700
On Sun, 10 Apr 2011 22:29:55 +0200, Gabriel Zachmann <email@hidden> said:
>>> I am creating CA layers like so:
>>>
>>> CALayer * imgLayer = [CALayer layer];
>>> imgLayer.contents = (id) image;
>>> imgLayer.contentsGravity = kCAGravityResizeAspect;
>>> imgLayer.delegate = nil;
>>> imgLayer.opacity = 1.0;
>>> imgLayer.position = CGPointMake( drawRect_.size.width/2.0, drawRect_.size.height/2.0 );
>>> imgLayer.anchorPoint = CGPointMake( 0.5, 0.5 );
>>> imgLayer.zPosition = -1.0;
>>>
>>> Now, sometimes, the image does not get displayed (most images do get displayed).=
>>
>> What is "image"?
>
>Sorry for forgetting to tell: 'image' is a CGImageRef, which I create like so:
>
> CGImageRef imageRef = CGImageSourceCreateImageAtIndex( sourceRef, 0, NULL );
>
>Any ideas what might go wrong?
Well, my next guess is the frame. I don't see you setting the layer's frame anywhere, so its size is zero by zero, which means that it is effectively invisible.
Show all the code by which the layer is configured and put into the interface if you want a more educated response. m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook_______________________________________________
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