Re: Screenshot of a GtkWindow

On Wed, 2008-07-23 at 13:32 +0200, Gabriele Greco wrote:
I need to make a screenshot of a GtkWindow from the program itself

We used code from gnome-utils's gnome-screenshot/gnome-screenshot.c and
gnome-screenshot/screenshot-utils.c to add a capture capability to
java-gnome (we wanted window decorations and all, not just the GdkWindow
behind something; the drop shadows are nice too). We use this when
generating our API documentation, for example:

I certainly appreciate now that gathering a screenshot (window borders
and all) is very tricky and involves some voodoo mucking about with X. I
am quite thankful that such code existed to be reused.

Unfortunately it's not a library as yet, so we had to copy it manually.
Our import of it was a bit hack-and-slash, but our versions of the above
two files, as gnome_screenshot_capture.c and gnome_screenshot_utils.c,
can be found in ïa checkout of a java-gnome in the src/jni/ directory,


Andrew Frederick Cowie

Operational Dynamics is an operations and engineering consultancy
focusing on IT strategy, organizational architecture, systems
review, and effective procedures for change management. We actively
carry out research and development in these areas on behalf of our
clients, and enable successful use of open source in their mission
critical enterprises, worldwide.

Sydney   New York   Toronto   London

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]