ios - How to draw CALayer border around its mask? -
so, have calayer
, has mask & want add border around layer's mask. example, have set triangle mask layer , want have border around layer.
can please me solve problem?
some suggestions:
- use opaque shadow instead of border (you have blurred effect).
- create layer, set background color color want border, mask mask bigger 1 have simulate border width, , put centered behind layer (may not work every shape).
- do morphological operation on mask image calculate border, instance
vimagedilate
family of functions (more complicated, , may run performance problems). - if know shape , can described mathematically, draw , stroke explicitly core graphics functions.
- or, in same case (shape known mathematically), use
cashapelayer
draw border.
Comments
Post a Comment