Re: Array of Gdk::Pixbuf*



>Hi,
>I;m reading an avi using libavifile and  I want to store the frames in an  
>array for later processing.  When I try the following I get an error  
>message that there is no "constructor" for Gdk::Pixbuf.
>
>Glib::Refptr<Gdk::Pixbuf> framebuffer = new Gdk::Pixbuf[numFrames];
>
>Perhaps I'm approaching it the wrong way?  Any suggestions would be  
>appreciated.

Chances are you are going to want to store some type of image in those pixbuf(s). You are placing the number of elements in the wrong place.

To declare the array, use:

Glib::RefPtr<Gdk::Pixbuf> framebuffer[numFrames];

Then to create the Pixbuf, you can use one of the following:

framebuffer[somenumber] = Gdk::Pixbuf::create_from_file("...");
framebuffer[somenumber] = Gtk::Invisible::render_icon(...);

There are plenty of other functions at http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGdk_1_1Pixbuf.html

There are also a few constructors listed which I believe you could just use this, although I'm not quite sure if you need Glib::RefPtr before the constructor or even if this example would work:
framebuffer[somenumber] = new Gdk::Pixbuf(...);

I hope this helps...

---
Andrew Krause
andrew openldev org
www.openldev.org 
             



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