Re: [gtkmm] Gtk::Image scale?





Akbar wrote:
I use this to display wallpapers:


    Gtk::Image* m_Picture;
    m_refGlade->get_widget("picture", m_Picture);
    if(m_Picture) {
        // some code here
        Glib::ustring temp = row2[m_Columns.m_col_wallp];
        m_Picture->set(temp);
    }

However my wallpaper is too big to display in my window. How can I scale
it?
Akbar,

If you load the image first into a Gdk::Pixbuf, you can use its scale() or scale_simple() methods, then use Image->set(Pixbuf).

Good luck,
David



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