current version : 0.2.3
last update 17/01/2000

author : Nicolas Roard



I'm currently working on the 0.2.4, here is the new features :

09/01/2000 Attention!

There is another graph lib named paintlib, made by Ulrich von Zadow, which you could find at .
So i changed the name in TwinLib (thanks to Jérôme Bourguignon).


TwinLib is a small but useful graphic c++ library. It's designed to help developpers in graphic programming under Qt , by providing cool functions like gradients, antialias on graphics primitives and text, alpha channel support...

The base principle of TwinLib is to declare an object of type Image (which is the base type of TwinLib).

An object Image is only a QImage object with many functions around it, so, by example, you could do something like that :

Image toto ("pipo.jpeg");
toto.line (10,10,100,100,QColor (200,0,0));

Those two lines load a jpeg image in toto, and trace a red line on it.

If you want to get the QImage contained in toto, just do a call.

That's all ! all others things are basically the same, with others functions (circle, gradients, text, etc.), so now you could read the html doc ;-)


There are little screenshots of the lib :


First of all, Qt . I used Qt 1.44 but Qt 2 should be also okay...
The lib require also the Qt's extensions for loading jpeg and png files.
go and get these on Troll Tech's web site ( (You must get a source version of Qt and compile the extensions)
So, you need of course jpeg and png libs.
You need also tmake, a very powerful tool to make makefiles :


Untar twinlib.0.2.3.tgz somewhere. Now you must compile the library by typing 'make' ; type make install to install it.
To have the example, type 'make example'. You should launch ./example to see some examples.

If you want to desinstall TwinLib, just type make uninstall.

I had tested it on a RH6 , Mandrake6 and Mandrake7beta on x86, all seems to work correctly (don't forget to install tmake, and to set TMAKEPATH and QTDIR !) There is the var PATHLIBS in the Makefile, it's the path to install TwinLib. If the example don't work because it doesn't find the lib, /sbin/ldconfig should be launched.

Known Bugs

Works ugly in 16bpp [reported by Jan Prokop]
idem with Qt2.0 (perhaps the same bug)


Many things, like erase all possibles bugs, adds some others graphics primitives (splines, etc), adds better algorithms and improve speed...


For any comments, bugs, you could mail me at . I need to have reports to improve this lib, so don't hesit ! This lib must have many bugs and Bad Things, so if you say me, it could be removed or improved faster...


The changelog is here .


You could download TwinLib 0.2.3 here


An online documentation is available here