你如何在Flash中得到影片剪辑多边形?多边形、影片剪辑、如何在、Flash

2023-09-08 11:39:33 作者:不再为爱惊奇

我有读取SWF和经历在影片剪辑它的一个动作。

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

在影片剪辑应该是简单的形状。我想在这些的movieclip将数据转换成多边形。换句话说,我想了一系列重新present形状上的影片剪辑的坐标。

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.

推荐答案

有没有简单的方法来做到这一点。一旦形状被吸引到舞台上,你可以访问唯一的图形信息的渲染像素的位图;所有矢量信息丢失。

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.

要变换形状为多边形,你就必须要么分析存储在SWF文件(找到的动作字节code和提取包含矢量绘图信息的字节,并用它来重新创建$形状C $ C),或者使用位图的颜色信息跟踪的形状(这是永远不会完全准确,因为你可能已经猜到)。

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.