Re: Any Libraries Out There for Generating Graphics Files? [message #169924 is a reply to message #169910] |
Thu, 30 September 2010 10:57 |
Richard Kettlewell
Messages: 7 Registered: September 2010
Karma:
|
Junior Member |
|
|
"Datesfat Chicks" <datesfat(dot)chicks(at)gmail(dot)com> writes:
> I'd like to produce graphs and figures, exported to a file like a .PNG
> or .GIF or .JPG.
>
> I'd like to produce these files directly from a C program.
>
> I remember from using PHP that PHP has some functionality built in
> where you create a graphic canvas then make calls to put lines and
> text on it, then you can emit it as a .PNG. I'm looking for something
> like that: a bunch of graphics primitives that draw on a canvas
> (where the canvas is a software construct), then you can export the
> canvas to a file when you're done manipulating it.
>
> Are there any libraries like this, callable from C, out there?
I know of a couple:
http://www.cairographics.org/ is at heart a vector drawing library, with
the ability to render to any number of file formats (including PNG).
It's what I used last time I wanted to draw graphs, and it worked well.
Do read the FAQ.
http://www.libgd.org/ is more pixel-oriented and perhaps less ambitious
than Cairo, but AFAIK pretty widely used. It's a long time since I've
used it but as I recall it got the job done.
You don't say what platform you're using, but it's possible it already
includes both of these.
--
http://www.greenend.org.uk/rjk/
|
|
|