openfrog
openfrog

Reputation: 40765

How to add an CALayer or UIImageView using different blending modes like screen, multiply, darken, lighten, color dodge, color burn, etc.?

I remember there are such blending modes available, but couldn't find how to do it in the CALayer docs. Does anyone know the trick?

Upvotes: 1

Views: 1373

Answers (1)

tc.
tc.

Reputation: 33602

I don't think you can specify the blend mode used for compositing a CALayer or UIView (in particular, I suspect the "old" graphics hardware of the iPhone 3G doesn't support it; not sure about the 3G S).

You can specify the blend mode when doing custom drawing (e.g. -drawRect:) with -[UIImage drawInRect:blendMode:alpha:] and the relevant CGContext functions, however the resulting layer contents will be composited with (the equivalent of) kCGBlendModeNormal.

Upvotes: 4

Related Questions