[Gtk-sharp-list] Setting pixels colors of a Pixbuf

Stephane SOPPERA stephane.soppera@free.fr
Wed, 05 Mar 2003 23:42:29 +0100

>>I want to store a computed picture to a file under linux using mono.
>>Since System.Drawing.Bitmap is not yet implemented, I though I could use
>Did you use this constructor:
>	Pixbuf(byte [] data, bool has_alpha, int bits_per_sample, 
>	      int width, int height, int rowstride,
>	      Gdk.PixbufDestroyNotify destroy_fn)
Actually it was a mistake in my Gtk# installation.
Someday, for an older version of Gtk#, I used ./configure --prefix=/usr 
and forgot about it. So I was using an old version where this 
constructor didn't exist and that's why mcs was allways complaining 
about a non-existing constructor....

>>But I failed to create a Pixbuf from datas in a byte[] (mcs says that
>>the corresponding constructor does not exist) and I also failed to find
>>a function that will set the color of a given pixel.
>The data stored in the pixbuf is layed out as 3 or 4 bytes per pixel
>(depending on whether you are using RGB or RGBA formats).   And the
>buffer is expected to contain a line of width pixels (the line is
>actually as long as rowstride, which can be used to "pad" the line,
>typically rowstride will be equal to width) and composed of height rows.
Thanks for the explanation.

>There is a bug in the current binding, so you can not extract the Pixels
>value currently.
I saw that ;-)
Is not important for me now, but it will be in a next future. Is someone 
allready working on this? Should it be soon fixed?

Thanks for your answer and your great work,

Stephane SOPPERA