[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

"Snapshotting" of a ruby-gnome application

Marc Heiler

11/16/2006 3:02:00 AM

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

1 Answer

Kouhei Sutou

11/16/2006 3:17:00 AM

0

Hi,

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

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