On 5/28/07, Francis BACQUE <[EMAIL PROTECTED]> wrote:
> how can I retrieve the color of a pixel at x,y coordinates of a
> Gdk::Pixbuf?

I have a set of helpers here:

  http://people.iola.dk/olau/misc/pixbuf-drawing.hpp

You instantiate a PixelPosition with get_position(pixbuf, x, y). The
pixel position can be moved around efficiently, and you can get to the
pixel underneath with PixelPosition::pixel(), e.g.

  Pixel p = get_position(pixbuf, x, y).pixel();
  p.red() = 0xFF;
  p.green() = 0xAF;
  p.blue() = 0xAF;
  p.alpha() = 0x50;

There's also PixelIterator for iterating through all pixels of a pixbuf.

-- 
Ole Laursen
http://www.iola.dk/
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to