helene_t Posted November 25, 2009 Report Share Posted November 25, 2009 I am writing some stuff for my work and need very simple graphics routines. Something like: #include<simplegraphicslib.h> main() { GraphicsBuffer *mybuffer = makeGraphicsBuffer (100,100,colors16); rect (mybuffer, 0,0,33,99, blue); rect (mybuffer, 34,0,66,99, white); rect (mybuffer, 67,0,99,99, red); writeGraphicsBuffer (mybuffer, "frenchflag.png");} Any suggestions? Could also be useful for making pictures for birthday greetings. Quote Link to comment Share on other sites More sharing options...
hotShot Posted November 25, 2009 Report Share Posted November 25, 2009 I haven't used these, but perhaps this helps: http://pngwriter.sourceforge.net/ (as your example creates a png) Or pick on on the other C/C++ libraries from here: http://www.freeprogrammingresources.com/imglib.html Quote Link to comment Share on other sites More sharing options...
helene_t Posted November 25, 2009 Author Report Share Posted November 25, 2009 Thanks HotShot, pngwriter looks very easy to use. Also thanks to Csaba for suggesting Gd, slightly more complex but still easy to use, supports more file formats. http://gnuwin32.sourceforge.net/packages/gd.htm Quote Link to comment Share on other sites More sharing options...
MattieShoe Posted November 29, 2009 Report Share Posted November 29, 2009 gd is nifty. I haven't done much graphics in C/C++, but XNA uses C# and has some very simple and very powerful stuff, and the IDE/compiler is free from Microsoft. I did some silly simple code for effecient circle packing with it for fun.http://farm4.static.flickr.com/3485/3796580568_4780d21a01.jpgTook very little time to code. You can use image files like pngs, place them, scale them, rotate them, adjust their transparency, use antialiased fonts, etc. Pretty slick. I made a little boids program with it too, just to familiarize myself with it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.