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

Miguel de Icaza miguel@ximian.com
10 Mar 2003 00:38:51 -0500


> > Gdk.Pixbuf.Pixels.
> > 
> > I am afraid that using byte [] might make a copy of the data, so we
> > should probably use byte * as the return value.
> Okay, yeah, this is an evil api to wrap.  byte[] is probably going to
> get us a copy, but dietmar is probably better equipped to answer that
> than me.
> One possible way to deal with this in a .Net friendly way would be to
> create an opaque type that exposes an indexer and IEnumerable and
> gets/sets individual items in the raw array.  Kind of a MarshaledArray
> class.

The indexer could be a type-safe version of it, but I still think that
we should expose the `byte *' from the pixbuf.  People who do image
handling are very likely to be interested in getting the most
performance out of it.