Is there any way to convert mask image to UIBezierPath in iOS

I wanted to show animation on parts of the image, like coloring. I achieved this with masking, but it's hard for performance.

I'm looking for a way to convert a mask to UIBezierPath, so I can add animation on layers in a UIView every time, rather than a UIView object.

I am trying to follow the exact MagicWand method for Mac but it has many Cocoa classes. Can anyone suggest me a solution to convert a mask or image to a UIBezierPath object according to iOS classes or any tutorial to find the key?

Thanks in advance.

+6
source share
2 answers

Please see PocketSVG if you are fine using SVG for images. You will get an array of bezier-free paths for the given svg. You can add each of these paths as a separate CAShapeLayer object and add any animations to their path and fill the color as intended using CABasicAnimation.

I hope he answers your question.

+1
source

Code.org has an application called "Application Lab", you can use colors and pictures for editing using code.

0
source

Source: https://habr.com/ru/post/1015879/


All Articles