1
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3
! Midas procedure screendump.prg
4
! U. Kaeufl ESO - Garching
7
! make a screen dump of displayed image and save in inmage-file
8
! using xwininfo, xwd (from X11) and convert (from ImageMagick)
10
! use as @a screendump image-file
11
! where the type of image-file determines the format chosen,
12
! e.g. abc.gif, def.tiff or xyz.eps
13
! default of image-file is: midas_graph.jpg
17
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19
defi/param P1 midas_graph.jpg ? "Name of output file"
21
defi/local sessnr/i/1/1 00 ! obvious
22
defi/local dispunit/c/1/100 "MIDAS_xx display_y"
23
defi/local disp_id/c/1/20 "xx" !to hold display id
26
write/keyw dispunit/c/7/2 {mid$sess(9:14)}
28
write/keyw dispunit/c/18/1 {dazdevr(10)}
31
$ xwininfo -root -tree | grep "{dispunit}" > atmund
33
create/image am_null 1,1
34
copy/ad atmund am_null dummy
36
! note, write/key disp_id <atmund does not work due to
37
! "special" character ` " '
39
copy/dkey am_null dummy disp_id
41
$ rm am_null.bdf atmund
43
if mid$sys(1:3) .eq. "Lin" then
44
$ xwd -id {disp_id} -silent > gra2jpg_dummy
46
$ xwd -id {disp_id} > gra2jpg_dummy
49
$ convert gra2jpg_dummy {P1}