On Thu, 26 Sep 1996, Phil Davis wrote:
> Does anyone know a way to automate the capture of a part of the screen?
> I tried something like:
>
> import snapshot
> drag from a,b to x,y
>
>
but it didn't work. Am I missing something? >
It looks like snapshot goes into a mode - my guess is that it is doing an
XNextEvent loop until the user nominates a window to grab. Anyway, if
nothing else works you could fork off a process to do an xwd (X window
dump - assuming you're on unix and not windows) with the id of the window
you are interested in. A bit of pbmplus like xwdtopnm and pnmcut should
give you the x1,y1 to x2,y2 you want. This may take some time but it
should work. Off the top of my head it would go something like this
put the windowid of stack XXX into myid
put "xwd -id " && myid && "| xwdtopnm | pnmcut " && X && Y && W && H && \
" > dump.pbm"
import pbm from file "file.pbm"
If you wanted the whole window it would be a lot easier as MC can import
xwd files directly. If the window is not a MC stack it is still possible
to find its window id if you know its name using xlswins or something
like that. (Hack, hack, hack...)
In case you didn't know, pbmplus is a command line toolkit for image
conversion and manipulation. It is wide available on ftp servers and can
be found with any search engine.
Good luck,
Eddy Mc Daid.
-------------------------------------------------------------------
Eddy Mc Daid Project Manager Interactive Systems Centre
Telephone: +44-1504-375622 Fax: +44-1504-370040
WWW: http://www.iscm.ulst.ac.uk/isc/isc-staff/eddy.html
-------------------------------------------------------------------
Any opinions expressed are mine but may be freely shared by others.