在 Flex 4 中将 SVG 图像转换为位图数据
我正在开发一个 Flex 项目,我必须加载几个 SVG 文件并比较它们的像素。为了比较像素,我喜欢将它们转换为字节数组(BitMapData)。我可以为 PNG 图像创建位图数据,但不能为 SVG 图像创建位图数据。 谁能帮助我克服这个问题?
谢谢!
I am working on a flex project, where I have to load a couple of SVG files and compare their pixels. To compare the pixels, I like to convert them into a byte array (BitMapData). I am able to create a bitmap data for a PNG image, but not for a SVG image.
Can anyone help me overcome this one?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以获得 SVG 的 BitmapData,因为它以矢量数据形式出现。在矢量中没有像素,只有描述如何渲染图形的几何基元。不过,您可以拍摄快照Flex 中的任何组件,然后您可以对其进行比较。
You can get BitmapData for the SVG because it's coming in as vector data. In vector there are no pixels just geometrical primitives which describe how to render the graphics. However you can take a snapshot of any component in Flex which you could then compare.