Thanks. With your help, I was able to make it work. In fact, I was
just missing the push_rgb_visual call. (I don't know what exactly it does).

But it looks like gdkrgb is much slower than imlib. I used a 800x800 image
that
I display in a scrolled window. When I move the scrollbars, the image gets
updated
very slowly (square by square), whereas the same image converted to an rgb
moves
smoothly with imlib.

By the way, what is the libglade library ? So far, I used pyglade to parse
my xml glade files and create my widgets. It works fine, except for a few
little things that I had to modify in the build.py file. (But it may be
because of the version of glade I'm using (0.4.1)). If you are interested,
I can give you the list of the changes I made (for example, in the table_new
function, the keyword for the column spacing is column_spacing, and not
col_spacing)

Remi.

> -----Original Message-----
> From: James Henstridge [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 21, 1999 6:36 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [pygtk] Greyscale images with imlib
>
>
> I am not sure what is causing the problems for you.  Here is a test
> program I wrote.  Do you get errors when running this one?
>
> from gtk import *
>
> # this bit is a little slow ...
> data = ""
> for i in range(255):
>         for j in range(255):
>                 data = data + chr((i+j)/2)
>
> push_rgb_visual()
>
> win = GtkWindow()
> win.connect("destroy", mainquit)
> da = GtkDrawingArea()
> da.size(255, 255)
> def expose(wid, event):
>
> wid.draw_gray_image(wid.get_style().fg_gc[STATE_NORMAL], 0,0, 255,255,
>                             GDK.RGB_DITHER_NORMAL, data, 255)
> da.connect("expose_event", expose)
> win.add(da)
> win.show_all()
> mainloop()
>
>
> As for scaling, gdkrgb does not provide support for that.  There is
> another library called libart that can handle those sort of
> things, but I
> don't have a wrapper for it at the moment.
>
> James.
>
> --
> Email: [EMAIL PROTECTED]
> WWW:   http://www.daa.com.au/~james/
>
>

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to