# "Snapshotting" of a ruby-gnome application

**URL:** <https://www.ruby-forum.com/t/snapshotting-of-a-ruby-gnome-application/76131>\
**Category:** Ruby\
**Created:** [November 16, 2006, 4:01am UTC](https://www.ruby-forum.com/t/snapshotting-of-a-ruby-gnome-application/76131 "2006-11-16T04:01:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![quik77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/dec6dc/32.png) [@quik77](https://www.ruby-forum.com/u/quik77)\
**Post date:** [November 16, 2006, 4:01am UTC](https://www.ruby-forum.com/t/snapshotting-of-a-ruby-gnome-application/76131/1 "2006-11-16T04:01:33Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![quik77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/dec6dc/32.png) [@quik77](https://www.ruby-forum.com/u/quik77)\
**Post date:** [November 16, 2006, 4:18am UTC](https://www.ruby-forum.com/t/snapshotting-of-a-ruby-gnome-application/76131/2 "2006-11-16T04:18:35Z")

</div>

Hi,

2006/11/16, Marc H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 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,
