Re: GdkPixbuf questions
- From: David Nečas (Yeti) <yeti physics muni cz>
- To: gtk-list gnome org
- Subject: Re: GdkPixbuf questions
- Date: Wed, 21 Mar 2007 09:09:34 +0100
On Wed, Mar 21, 2007 at 03:50:44PM +0800, s88 wrote:
> I have some questions when I using the drawable area with the
> gtk+2.0.
> First, I'm building a data analyzer under thr Linux, so there is a process
> to generate the data and my analyzer display the data.
> My idea is to use a drawable area(I use the GtkDrawingArea) and get the pix
> buffer of it by the gdk_pixbuf_get_from_drawable(),
There is no such thing as `the pixbuf of it'. Every time
you call gdk_pixbuf_get_from_drawable() a new image of the
drawable is created and put to the pixbuf. Read the first
paragraph of gdk_pixbuf_get_from_drawable() description.
And if parts of the drawable are obscured, you get garbage
there -- see paragraphs 5 and 6. And the other paragraphs
too.
> then my background
> program can fill the pix buffer pix by pix.
You can do anything you wish with the pixbuf, but it will
have no effect on the widget.
> Question 2: the following code segment is what I done until now...what
> should I do?
If you want to display a pixbuf, just create a pixbuf with
gdk_pixbuf_new(), fill its contents and draw it with
gdk_draw_pixbuf() in the expose event of the widget.
Yeti
--
http://gwyddion.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]