Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross-platform drawing library

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.

like image 289
Gerald Avatar asked Jul 29 '09 14:07

Gerald


1 Answers

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).
like image 82
Tomas Andrle Avatar answered Sep 18 '22 14:09

Tomas Andrle