On Fri, 2005-06-24 at 17:24 +0200, Thomas Pryds Lauritsen wrote:
> I have a Gdk.Pixmap p from which I need to fetch the colour of certain
> pixels. Something like
> 
> Gdk.Color c = p.getColorOfPixel(x, y);
> 
> would be preferred, but I haven't been able to find any info on this
> matter. Surely this must be possible, but the question is: how?

The "Pixels" property gives you access to the raw pixel data. However,
it's an unmanaged array, so you'll need to use unsafe code to work with
it.

http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#image-data

gives an example of C code that accesses individual pixels directly. The
unsafe C# code would be similar.

-- Dan


_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to