On Sun, 10 Apr 2011 22:29:55 +0200, Gabriel Zachmann <z...@tu-clausthal.de> 
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 = m...@tidbits.com, <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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to