有没有办法导出 DisplayObject 的矢量数据?
Flex 提供了将显示对象导出为位图的功能,如下所示:
var bitmapDataBuffer:BitmapData = new BitmapData ( displayObject.width, displayObject.height, false);
bitmapDataBuffer.draw ( displayObject, displayObject.transform.matrix);
有没有一种方法可以将显示对象导出为矢量图形而不是位图数据?
Flex gives the ability to export a display object as a bitmap as follows:
var bitmapDataBuffer:BitmapData = new BitmapData ( displayObject.width, displayObject.height, false);
bitmapDataBuffer.draw ( displayObject, displayObject.transform.matrix);
Is there a method to export a display object as a vector graphic instead of bitmap data?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
copyFrom()<
Graphics
对象上的 /code>函数可能正是您所需要的。 它被添加到 Flash Player 10 中。
The
copyFrom()
function on theGraphics
object might be what you need. It was added in Flash Player 10.您可以使用 svgeditor-as3 库,但是它使用自己的抽屉引擎,但它非常强大,并且可以导出为 SVG 格式。
您可以在这里找到更多信息:
http://code.google.com/p/svgeditor-as3/
You can use the svgeditor-as3 library, however it uses it's own drawer engine, but it's very powerful, and can export in SVG format.
You can find more here:
http://code.google.com/p/svgeditor-as3/
我将从这个错误中猜测目前不可能:
http://bugs .adobe.com/jira/browse/FP-605
I'm going to guess from this bug that it's not currently possible:
http://bugs.adobe.com/jira/browse/FP-605
简而言之,不,但您可以尝试转换为位图,然后矢量化位图(类似于 行进squares 算法)
如果您在 AS 中绘制它,您可以通过扩展 Graphics & 来跟踪您的绘制。 Sprite 或 Shape 使用新类。
In short, no, but you could try to convert to a bitmap and then vectorize the bitmap (something like the marching squares algorithm)
If you are drawing it in AS, you could keep track of your drawing, possibly by extending Graphics & Sprite or Shape to use the new class.