在 Flex 4 中将 SVG 图像转换为位图数据

发布于 2024-12-12 04:00:33 字数 141 浏览 4 评论 0原文

我正在开发一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甩你一脸翔 2024-12-19 04:00:33

您可以获得 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文