"Snapshotting" of a ruby-gnome application

Using Gtk::Image and Gtk::Pixbuf, and a widget where you can move
the images around, it is possible to draw ... uh, images.
A little bit like Gimp with fixed objects.

But, aside from making a Snapshot with something like ksnapshot,
does anyone know of a way to get the current "assembled Images "
from a widget (any widget at all)?

Specifically, I would like to make a "dumb" Image "drawing"
application, and would like to be able to store the final
image result somewhere. (Think of some flash
applications that do that)

···

--
Posted via http://www.ruby-forum.com/.

Hi,

Specifically, I would like to make a "dumb" Image "drawing"
application, and would like to be able to store the final
image result somewhere. (Think of some flash
applications that do that)

You can do with Gdk::Drawable and Gdk::Pixbuf.
The following example snapshots your desktop.

  require 'gtk2'
  drawable = Gdk::Window.default_root_window
  pixbuf = Gdk::Pixbuf.from_drawable(drawable.colormap, drawable, 0, 0,
                                     *drawable.size)
  pixbuf.save("x.png", "png")

Thanks,

···

2006/11/16, Marc Heiler <shevegen@linuxmail.org>:
--
kou