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

  • From: "Guillaume Legris" <glegris@xxxxxxxxxxxx>
  • To: gtk-server@xxxxxxxxxxxxx
  • Date: Mon, 30 Apr 2007 12:56:17 +0200

Hi Peter,

Thanks for your answer.

As I have to use the client remotely, I need to add new GTK-SERVER
calls to read/write data at the given address, like:

gtk_server_set_data, NONE, NONE, LONG (address), BASE64 (data)
gtk_server_get_data, NONE, BASE64 (data),  LONG (address), LONG (length)

Am I right ?

Regards,
Guillaume Legris

2007/4/28, Peter van Eerten <administrator@xxxxxxxxxxxxxx>:
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: