I am writing my first programme with gtk and as part of it, I have a Gtk::Image which is loaded as the user clicks on a TreeView item.
Loading the image is fine, but instead of fitting the bitmap to the size of the Gtk::Image, the Gtk::Image is expanded to fit the bitmap. I've been trying for about four hours to get the bitmap to automatically resize to the Gtk::Image. I can hardly believe that something so simple is so difficult.
I have given up on the automatic resizing, and tried to load the bitmap to a Gdk::Pixbuf, resize it manually and then load the Gtk::Image with the Gdk::Pixbuf, but the resizing just doesn't work. Here's my code:
Do any of you understand why the Pixbuf isn't resizing? Can anyone help with the automatic resizing?Code:Glib::RefPtr<Gdk::Pixbuf> temp = Gdk::Pixbuf::create_from_file(row[in_files.fullname]); temp->scale_simple(750, 600, Gdk::INTERP_BILINEAR); img_scrshot.set(temp);