Re: [gtkmm] Example for Gdk::Pixbuf::create_from_data(...)



Tobias Roth <roth iam unibe ch> writes:
> I am having trouble to get pixel data from an array into a
> Gdk::Pixbuf and need an example. I am trying to define a
> button that will create an all white 400x300 pixel buffer when
> clicked on (this will emerge into several buttons that apply
> different filters to an image eventually).

I have never tried this, but instead of messing with create_from_data,
I would do something like this:

  Glib::RefPtr<Gdk::Pixbuf> pixbuf = Gdk::Pixbuf::create(...);
  pixbuf->fill(0xFFFFFF);

Then there are some methods in Gdk::Pixbuf to retrieve a pointer to
the data and help navigating the pixels.

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]