Re: CALayer UIImage rendered on top of content instead of below
On 12/15/12 12:36 AM, David Duncan wrote: I would expect to see a red rectangle, I get the image. Why? Would someone set me straight, I feel I'm missing something basic. Unfortunately I think you've removed too much context here. Since you say you are doing this in your own layers, it would be useful to know which class is acting as the delegate, and what the complete -drawLayer:inContext: method looks like (primarily because you are using the UIKit methods that expect an implicit context). -- David Duncan Turns out, I had another layer on top of my layer that (by accident) drew the image at the same location. Sorry for the noise, guys! Regards Markus -- __ Markus Spoettl ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CALayer UIImage rendered on top of content instead of below
On Dec 14, 2012, at 3:07 PM, Markus Spoettl wrote: > Hi, > > I have custom UIView with multiple layers, all custom drawn via delegate. In > one layer, I draw an image and on top of that image, I draw bezier paths and > rects. Or so I try. For some reason the image is rendered ABOVE what I draw > OVER it later. > > So basically I have this (this is the actual code I reduced it to): > > [img drawInRect:imgRect blendMode:kCGBlendModeNormal alpha:1.0]; > > followed by > > [[UIColor redColor] setFill]; > UIRectFill(imgRect); > > I would expect to see a red rectangle, I get the image. Why? Would someone > set me straight, I feel I'm missing something basic. So if you create a new project, subclass UIView, and implement -drawLayer:inContext: like this, you get bad drawing? --Kyle Sluder ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CALayer UIImage rendered on top of content instead of below
On Dec 14, 2012, at 3:07 PM, Markus Spoettl wrote: > I have custom UIView with multiple layers, all custom drawn via delegate. In > one layer, I draw an image and on top of that image, I draw bezier paths and > rects. Or so I try. For some reason the image is rendered ABOVE what I draw > OVER it later. > > So basically I have this (this is the actual code I reduced it to): > > [img drawInRect:imgRect blendMode:kCGBlendModeNormal alpha:1.0]; > > followed by > > [[UIColor redColor] setFill]; > UIRectFill(imgRect); > > I would expect to see a red rectangle, I get the image. Why? Would someone > set me straight, I feel I'm missing something basic. Unfortunately I think you've removed too much context here. Since you say you are doing this in your own layers, it would be useful to know which class is acting as the delegate, and what the complete -drawLayer:inContext: method looks like (primarily because you are using the UIKit methods that expect an implicit context). -- David Duncan ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
CALayer UIImage rendered on top of content instead of below
Hi, I have custom UIView with multiple layers, all custom drawn via delegate. In one layer, I draw an image and on top of that image, I draw bezier paths and rects. Or so I try. For some reason the image is rendered ABOVE what I draw OVER it later. So basically I have this (this is the actual code I reduced it to): [img drawInRect:imgRect blendMode:kCGBlendModeNormal alpha:1.0]; followed by [[UIColor redColor] setFill]; UIRectFill(imgRect); I would expect to see a red rectangle, I get the image. Why? Would someone set me straight, I feel I'm missing something basic. Regards Markus -- __ Markus Spoettl ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com