[gtk-server] Re: How to access to the pixbuf data

  • From: Peter van Eerten <administrator@xxxxxxxxxxxxxx>
  • To: gtk-server@xxxxxxxxxxxxx
  • Date: Sat, 28 Apr 2007 20:06:55 +0200

Hi there,

First I would define the call 'gdk_pixbuf_new_from_data()' in the configfile as follows:

FUNCTION_NAME = gdk_pixbuf_new_from_data, NONE, WIDGET, 9, STRING, LONG, BOOL, LONG, LONG, LONG, LONG, NULL, NULL


The keyword 'STRING' in fact represents a C character pointer. If you define your image somewhere in memory, and pass the pointer to that memory as a number here, it should work.

If you plan to use 'gdk_pixbuf_get_pixels()' as well:

FUNCTION_NAME = gdk_pixbuf_get_pixels, NONE, STRING, 1, WIDGET


This will return a (char-) pointer, which in fact is a number pointing to memory.

Please let me know if this works.

Regards
Peter


Quoting Guillaume Legris <glegris@xxxxxxxxxxxx>:

Hi,

I'm writing a (TCP-based) Java client for GTK-server and I need to
draw an array of pixels created from the Java side.

I tried gdk_draw_point (as shown in
http://www.gtk-server.org/fractal.ksh) but it's too slow when there
are too many pixels to write.

I would like using gdk_pixbuf_new_from_data()  and/or accessing to the
pixbuf pixels with gdk_pixbuf_get_pixels (pixbuf)  instead.

How could I pass an array to the gdk_pixbuf_new_from_data() method ?
Is there a way to access to the pixels ?

Thanks in advance.

Regards,
Guillaume Legris

--
http://www.gtk-server.org

Other related posts: