On Mon, 22 Jun 2009 18:01:50 +0200
Giovanni Gherdovich <[email protected]> wrote:
| Could you please save me some time and give me an explaination
| on how to compute this ID?
| Is there some X11 conventions that is obvious to "insiders" but unknown to me?
| 
Later...
| I can use the xwininfo program from the shell, like this:
|

The X window ID is the number by which the X window system (the program
that displays application windows)  references windows, and other
objects on the display.

Every window, and even every sub-window (scroll panes, title bars, buttons,
input boxes, etc etc etc ) has such an ID.

The xwininfo allows you to list these things, and title (application)
names that are assigned, their size and relative positions within each
other, and how that equates to an absolute position on screen.

On special window is the 'root' window, which is the whole screen.

WARNING. if you grab a window, and another window is over the top of it
the image contents will either contain the overlaping window, or a
blank undefined (undrawn) area.  So make sure when grabbing windows
that window is ON TOP.

Xterms, and many other terminal windows report the window ID in the
environment variable "WINDOWID" as a decimal number. So scripts can
easily grab the contents of the terminal window from which it was run.

For example try this, whcih asks ImageMagick to display the contents
of the terminal you ran the command from...
    display x:$WINDOWID

There are also programs that can 'draw' into the specified window
even though it is not the application that created the window.

For example to draw into a window you can use the "xloadimage" program
However for this to work you need the right window.

For example lets get the 'child' window (the text area) of the current
terminal.
   child=`xwininfo -children -id $WINDOWID | sed -n 's/^ *\(0x[^ ]*\).*/\1/p'`
Now you can draw directly into that window
   convert rose: rose.png
   xloadimage rose:.png -windowid $child 

This method of direct drawing is actually used a lot, For example the
"ghostscript" program is often called to 'draw' postscript into a
particular application sub-window, of a postscript viewer, such as
"gv", "gsview" 

It is also how a separate "acroread" program can display a downloaded
PDF document directly in a "firefox" Web browser!



  Anthony Thyssen ( System Programmer )    <[email protected]>
 -----------------------------------------------------------------------------
  A Gods idea of amusement is a Snakes & Ladders game,
  with greased rungs.           -- Terry Pratchett, "Wyrd Sisters"
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to