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

View: New views
2 Messages — Rating Filter:   Alert me  

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

by Иван Васильев :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

-- реклама -----------------------------------------------------------
Домен БЕСПЛАТНО!
С хостинг-планом на http://www.hostpro.ua

_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list

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

by Simon Fuhrmann-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
> http://mail.gnome.org/mailman/listinfo/gtkmm-list

_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list
LightInTheBox - Buy quality products at wholesale price