How do you get Polygons from MovieClips in Flash?

 ̄綄美尐妖づ 提交于 2019-12-10 15:24:05

问题


I have an actionscript that reads an swf and goes through movieclips in it.

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


回答1:


There's no easy way to do this. Once a shape is drawn to the stage, the only graphical information you can access is the rendered pixel bitmap; all vector information is lost.

To transform shapes into polygons, you'll have to either analyze the ActionScript byte code stored in the SWF file (find and extract the bytes that contain vector drawing information and use it to re-create the shapes in code), or use the color info in the bitmaps to trace shapes (which is never going to be fully accurate, as you might guess).

Either way, this is not a simple task.



来源:https://stackoverflow.com/questions/12904491/how-do-you-get-polygons-from-movieclips-in-flash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!