Cross-platform drawing library

2019-02-01 01:50发布

I've been looking for a good cross-platform 2D drawing library that can be called from C++ and can be used to draw some fairly simple geometry; lines, rectangles, circles, and text (horizontal and vertical) for some charts, and save the output to PNG.

I think a commercial package would be preferable over open source because we would prefer not to have to worry about licensing issues (unless there's something with a BSD style license with no credit clause). I've looked at Cairo Graphics which seemed promising, but the text rendering looks like crap out of the box, and upgrading the text back-end brings us into murky license land.

I need it for Windows, Mac and Linux. Preferably something fairly lightweight and simple to integrate. I've thought about Qt but that's way too heavy for our application.

Any ideas on this would be awesome.

11条回答
2楼-- · 2019-02-01 02:25

I would go for AGG or Cairo.

查看更多
Luminary・发光体
3楼-- · 2019-02-01 02:31

Try Anti-Grain Geometry. From the description:

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:

  • Anti-Aliasing.
  • Subpixel Accuracy.
  • The highest possible quality.
  • High performance.
  • Platform independence and compatibility.
  • Flexibility and extensibility.
  • Lightweight design.
  • Reliability and stability (including numerical stability).
查看更多
干净又极端
4楼-- · 2019-02-01 02:31

Have a look at SFML. It's open source but the license is very permissive.

Drawing simple shapes
Displaying text

查看更多
狗以群分
5楼-- · 2019-02-01 02:31

Have you tried FLTK? It is lightweight, cross-platform, has support for 2D/3D graphics and comes with a good widget set (including a charting component). The API is simple and straight forward.

查看更多
戒情不戒烟
6楼-- · 2019-02-01 02:32
登录 后发表回答