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

Re: render fonts and get back the image by pixels



There have been lots of discussions on RGB values and
Drawing Areas/Pixmaps/Images on the gtk-list, lately.
Lots!  So, perhaps your best place for information is the
gtk-list archives.
http://www.gnome.org/mailing-lists/archives/gtk-list/1999-October

You probably want to draw into a pixmap or image instead of
straight onto the drawing area since you want to save to a file,
or if you're doing the expose/configure events as mentioned below.
A pixmap contains the colormap indices, but not the mapping.

If you are going to be manipulating the image, that's when you choose
an image over a pixmap.  If you're creating and just updating the screen,
or the image isn't dynamic a pixmap is fine.

Hope that helps you start.
Donna

----- Original Message -----
From: Francisco Oltra Thennet <foltra@papaya.ing.puc.cl>
To: <gtk-app-devel-list@redhat.com>; <nicolas@hal2000.hal.vein.hu>
Sent: Thursday, October 28, 1999 7:17 AM
Subject: Re: render fonts and get back the image by pixels


> On Thu, Oct 28, 1999 at 10:55:33AM +0200, Berci Norbert wrote:
> >
> > Hi !
> >
> > I have already sent a letter to this list, but unfortunately I have not
> > received any replies to it. :( I thought this list is a forum of non
trivial
> > questions and the people who knows the answer. If my question is RTFM,
or
> > so beginner, tell me. But getting no answer is a very bad thing.
> >
> > 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.
>
> You may you use GtkDrawingArea, get a GdkDrawable from the drawing
> area and use the gdk_draw_ functions. Something like
> ...
> GtkWidget *drwArea;
> GtkDrawable *drwBle;
> ...
> drwBle = drwArea->window;
> ...
> gdk_draw_rectangle ( drwBle,
>    drwArea->style->white_gc,
>      TRUE,
> 0, 0,
> drwArea->allocation.width,
> drwArea->allocation.height );
>
> gdk_draw_string ( drwBle,
> font,
> gc,
> bla...bla.....
>
> You got to connect it to the events configure_event, when the widget is
> created or resized, and expose_event, that is when a windows is moved off
> of it or gets repainted.
>
> Hope it helps
> --
> Francisco Oltra Thennet
> Departamento de Ingenieria Electrica
> Universidad Catolica de Chile
> (56)(2) 686-5968
> (56)(2) 552-2563 (fax)
> e-mail: foltra@puc.cl, foltra@latinmail.com
>
>
> --
>          To unsubscribe: mail gtk-app-devel-list-request@redhat.com with
>                        "unsubscribe" as the Subject.
>
> Mailing list concerns should be mailed to <listmaster@redhat.com>
>
>
>



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