Re: How to load image from file and to draw it in window?



You have to do sth. like this:

Glib::RefPtr<Gdk::Pixbuf> pic = Gdk::Pixbuf::create_from_file(fname);
Gtk::Image* img = Gtk::manage(new Gtk::Image(pic));
window->add(*img);
window->show_all();

1. Create pixbuf from file
2. Create image from pixbuf
3. Add it to some container
4. Show it

See the docs for details.

Simon

Иван Васильев wrote:
> How to load image from file and to draw it in window?
> 
> -- реклама -----------------------------------------------------------
> Домен БЕСПЛАТНО!
> С хостинг-планом на http://www.hostpro.ua
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list



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