将 SVG 图形加载到 FireMonkey 应用程序中需要采取什么方法?
我能想到大约有四种实现能够将 SVG 图形加载到 Delphi 应用程序中。
其中之一是 Mattias Andersson,他是 FMX 的作者。帆布VPR ,与 FireMonkey 合作,但他尚未准备好发布代码。
第二个是 Martin Walter 编写的,使用 VCL,但开发人员已退出 Delphi,并且没有计划转换为 FireMonkey。
第三个是 AGGPAS 框架的一部分,可与 VCL 配合使用,但不能与 FireMonkey 配合使用。
第四个项目正在由 Jason Southwell 开发,但日期尚未确定。
所以我的问题是:如果我今天想要一个 SVG 组件,而不是第五次(可能更多)重新发明轮子,该怎么走?
There are about four implementations I can think of that are capable of loading SVG graphics into a Delphi application.
One of those, by Mattias Andersson, who is the author of FMX.Canvas.VPR
, works with FireMonkey, but he's not yet prepared to release the code.
A second one, by Martin Walter, works with the VCL, but developer has quit Delphi and has no plans to convert to FireMonkey.
A third one, part of the AGGPAS framework, works with the VCL, but no FireMonkey.
A fourth one is in development by Jason Southwell, but no date has been fixed yet.
So my question: what road to take if I want an SVG component today, without trying to reinvent the wheel a fifth (and probably more) time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我是 Mattias Andersson——FMX.Canvas.VPR 的作者;我可以说我仍在积极致力于 SVG 解决方案。我想一旦我正确添加了对渐变和文本渲染的支持,我就可以发布第一个测试版本。我依赖 TXMLDocument,这对您可以执行的操作有一点限制(IMO),因此我不得不发明一些解决方法(也许更好的选择是从头开始实现我自己的 XML 类。)另外,我必须对 FireMonkey 类进行一些运行时修补,才能使一切正常工作。好的部分是我实际上是根据 SVG 接口规范来实现的。
I'm Mattias Andersson -- the author of FMX.Canvas.VPR; I can say that I'm still actively working on the SVG solution. I guess once I have properly added support for gradients and text rendering then I can release a first beta version. I'm relying on TXMLDocument and that is a bit restrictive in what you are permitted to do (IMO), so I've had to invent some workarounds (maybe a better option would have been to implement my own XML class from scratch.) Also, I've had to do some run-time patching of the FireMonkey classes in order to make everything work correctly. The good part is that I'm actually implementing things according to the SVG interface specifications.
我一直在开发的 SVG 组件已作为我们的 Apesuite for Firemonkey 的一部分发布。
http://arcana.sivv.com/apesuite
The SVG component I've been working on has been released as part of our Apesuite for Firemonkey.
http://arcana.sivv.com/apesuite
与 Mattias Andersson 一起参与开发是最好的选择:
SVG FireMonkey
组件工作自发布之日起,开箱即用(通常进行广泛的网络搜索)。Getting involved with Mattias Andersson in the development is the best option:
SVG FireMonkey
component working out-of-the-box is available as of the time of posting (extensive web search made in general).您还可以考虑使用 Chromiumembedded。只需在嵌入式浏览器中加载 svg 即可。然后你可以将 Delphi 代码与 javascript 混合,混合 html 和 css 等。
这样,你就可以让 Chrome 决定如何快速绘制东西(例如是否使用 GPU 加速)。
您将获得适当的 svg 支持,它很容易集成到您的应用程序中,它很灵活,并且在线有大量文档和示例代码。
You could also consider using Chromiumembedded. Just load the svg in the embedded browser. You can then mix Delphi code with javascript, mix in html and css, etc.
This way, you can just leave it up to Chrome how to draw stuff fast (for example whether to employ gpu acceleration or not).
You'll get proper svg support, it's easy to integrate into your application, it's flexible, and there is lots of documentation and example code available online.