papyrus logo

Gdk::Pixbuf from Papyrus::Canvas

Glib::RefPtr<Gdk::Pixbuf> create_pixbuf(Papyrus::Renderable::pointer, int width, int height)

Given a Papyrus::Renderable and size as width, height this method will create a Gdk::Pixbuf. This method will not resize the Papyrus::Renderable to fit on the Gdk::Pixbuf. It will simply render directly into the Gdk::Pixbuf.

Although the PapyrusGtk::CanvasArea is capable of displaying a Papyrus::Canvas, this utility method is provided for those cases where a Gdk::Pixbuf is needed instead. As an example, one such class present in Gtkmm is Gtk::CellRendererPixbuf.

The following contains an example that will add a Papyrus::Group to a Papyrus::Canvas, render the Papyrus::Canvas into a Gdk::Pixbuf, and display the Gdk::Pixbuf inside a Gtk::Image widget.


Screenshot created with code below; Gtk::Image containing Gdk::Pixbuf created with PapyrusGtk::create_pixbuf()

Generated on Fri Apr 16 12:41:04 2010 for papyrus by doxygen 1.6.1