Creating path from Bitmap android ribs

Is there any way I can create android.graphics.Path from Bitmap edges ? Suppose I have a hollow hexagon , then how can I create a path that follows its edges?

+4
source share
1 answer

There is no easy way to do this, since the path is part of vector graphics, while the bitmap consists of independent pixels. You can create an algorithm that will do this, but it will be complex and will never be 100% sure.

The best thing you can do is either start with vector graphics in the first place (for example, SVG), or abandon the dream of scalable graphics.

Sorry to disappoint you, but I tried to create a pseudo-code vector finder here, and even the simplest one is too complicated to write on the fly.

+1
source

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


All Articles