Saving DrawingArea to jpeg file



Hi all.
How can I save DrawingAreato a jpeg file?

I wrote this code, but it is working only for visible area. I have been
working on that all day, and I gave up.


    Glib::RefPtr<Gdk::Drawable> drawable =
static_cast<Glib::RefPtr<Gdk::Drawable> >(get_window());

    Glib::RefPtr<Gdk::Pixbuf> pixbuf = Gdk::Pixbuf::create(drawable,
                                       0,
                                       0,
                                       get_width(),
                                       get_height());

    if (pixbuf)
        pixbuf->save("filename.jpeg", "jpeg");



-- 
View this message in context: http://old.nabble.com/Saving-DrawingArea-to-jpeg-file-tp32457954p32457954.html
Sent from the Gtkmm mailing list archive at Nabble.com.



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