我一直在寻找一个不错的跨平台二维绘图库,它可以从 C++ 中调用,并且可以用来绘制一些相当简单的几何图形;一些图表的线条、矩形、圆形和文本(水平和垂直),并将输出保存为 PNG。
我认为商业软件包比开源软件更可取,因为我们宁愿不必担心许可问题(除非有没有信用条款的 BSD 风格许可)。我看过 Cairo Graphics,它看起来很有希望,但文本渲染看起来像是开箱即用的垃圾,升级文本后端会将我们带入模糊的许可证领域。
我需要它用于 Windows、Mac 和 Linux。最好是相当轻量级且易于集成的东西。我曾考虑过 Qt,但这对我们的应用程序来说太重了。
任何关于这方面的想法都会很棒。
最佳答案
试试 Anti-Grain Geometry .来自描述:
Anti-Grain Geometry (AGG) is an Open Source, free of charge graphic library, written in industrially standard C++. The terms and conditions of use AGG are described on The License page. AGG doesn't depend on any graphic API or technology. Basically, you can think of AGG as of a rendering engine that produces pixel images in memory from some vectorial data. But of course, AGG can do much more than that. The ideas and the philosophy of AGG are:
- 抗锯齿。
- 亚像素精度。
- 尽可能高的质量。
- 高性能。
- 平台独立性和兼容性。
- 灵 active 和可扩展性。
- 轻量化设计。
- 可靠性和稳定性(包括数值稳定性)。
关于c++ - 跨平台绘图库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1200727/