[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: render fonts and get back the image by pixels



> So please tell me which widget and which function(s) I have to use for
> the following:
>
> 1. I want to draw on the widget both colour pixels and colour primitives
>    (lines, circles, etc.) by the gdk_draw_ series of functions.
>
> 2. I want render colour fonts on it (e.g. display text on it)
>
> 3. I want it displayed in the application's window, of course ;)
>
> 4. I want to get the whole image by RGB values (or by colormap indexes,
>    but in this case I want to know the colormap index => RGB mappings,
>    obviously) so I can save it in a file for post processing.

I suppose you have three options, depending of the level of
sophistication you need (and the time you can afford to spend
on this):

1) Use GtkDrawingArea
There are a couple of good examples on using this widget
to produce a analogic watch, a simple game, etc... in
Eric Harlow's book (I belive you can get the code from
www.gtk.org). The GTK tutorial has a working example,
in gtk/examples/scribble-simple.

2) Use GnomeCanvas
I don't know nothing about this, so I am not going to
comment, but in Havoc Pennington's book there are two
whole chapters dedicated to this subject (about 50 pg).
You can access this book in www.gtk.org. Both Eric's
and Havoc's books are published by New Riders.

3) Use Mesa
Mesa is Brian Paul's LGPL implementation of OpenGL, the
state of the art SG graphis library. If you want to create
the next Quake game or to create all the special effects for
 a Walt Disney movie, this is the way to go. You can get all
the code and documentation you need in i) www.mesa3d.org,
ii) www.student.oulu.fi/~jlof/gtkglarea and iii) www.opengl.org

I guess what you need is option 1)

Carlos Pereira
Technical University of Lisboa
Portugal



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]