How do you get Polygons from MovieClips in Flash?

I have an ActionScript that reads swf and goes through the movie clips in it.

Clips should be simple. I want to convert the data in these movie clips to a polygon. In other words, I want a series of coordinates that represent the shapes in the movie clip.

+4
source share
1 answer

There is no easy way to do this. After the figure is displayed on the scene, the only available graphic information that you can get is the displayed bitmap of the pixel; all vector information is lost.

To convert shapes to polygons, you will either have to analyze the ActionScript byte code stored in the SWF file (find and extract bytes containing the vector drawing information and use it to recreate the shapes in the code), or use the color information in the bitmap images to track shapes (which, as you can guess, will never be completely accurate).

In any case, this is not an easy task.

+4
source

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


All Articles