Draw multiple Gdk::Pixbuf to one DrawingArea?



Hey all,

I've been trying to get this sorted for a while, and now I'm resorting to asking yee guys. :-)

I have a class that derives from a DrawingArea, and in this widget I want to display 2 .png files.

I have code to show 1 image:
Glib::RefPtr<Gdk::Pixbuf> faderImage= Gdk::Pixbuf::create_from_file("faderGreen.png");

faderImage  -> render_to_drawable(    get_window() ,
                                        get_style()->get_black_gc(),
                                        0, 0, 42, 100,
                                        faderImage->get_width(), faderImage->get_height(),
                                        Gdk::RGB_DITHER_NONE, 0, 0);

That code works perfect, just as I'd want it to. The problems start here:

I create another Pixbuf pointer:
Glib::RefPtr<Gdk::Pixbuf> backgroundImage;

And compiling will still work, but the program segfaults? Is there something that you can't have
2 Glib::RefPtr 's in one class or something?

Hope somebody can help, cheers, -Harry


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