home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / tcl / 1822 < prev    next >
Encoding:
Internet Message Format  |  1992-11-13  |  2.0 KB

  1. Path: sparky!uunet!know!mips2!news.bbn.com!usc!cs.utexas.edu!uwm.edu!linac!att!cbnewsm!gah
  2. From: gah@att.com (George A. Howlett)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: Creating and Import file from an xygraph plot
  5. Message-ID: <1992Nov12.214523.19035@cbnewsm.cb.att.com>
  6. Date: 12 Nov 92 21:45:23 GMT
  7. References: <1992Nov11.144249.11964@calspan.com>
  8. Sender: news@cbnewsm.cb.att.com (NetNews Administrator)
  9. Reply-To: george.howlett@att.com
  10. Organization: AT&T Bell Laboratories
  11. Lines: 41
  12. X-Newsreader: TIN [version 1.1 PL6]
  13. Nntp-Posting-Host: grenache.cnet.att.com
  14.  
  15. Carol Thielman (thielman@calspan.com) wrote:
  16. :       I am attempting to create a file depicting the information in
  17. :       a xygraph plot.  This file can be in one of two formats 
  18. :       1) postscript with a preview immage or 2) raster format.  I
  19. :       have looked at the output from the postscript function in xygraph
  20. :       and it does not contain a preview image.  Has anyone done this or
  21. :       have any ideas about the easiest way to create these files?
  22.  
  23. You could create a file containing the X window dump of the xygraph window 
  24. with following proc.  It uses the "xwd" program.  You simply give it
  25. the pathname of the xygraph widget and the name of the file store the
  26. window dump.
  27.  
  28. From there you can use xv, xwd2ps, or the pbmplus utilities to translate
  29. the xwd format to whatever format you choose (i.e. PostScript).
  30.  
  31. I don't know whether this solves your problem. 
  32.  
  33. --gah
  34.  
  35. ##############################################################
  36. #
  37. # CreateWindowDump --
  38. #  
  39. #    Dump the contents of the named window into a given
  40. #    file.  The procedure requires the use of the xwd
  41. #    program which comes with standard MIT X distribution.
  42. #
  43. #     w        - Pathname of widget window to dump
  44. #     fileName - Name of file to create (will automatically 
  45. #                 get .xwd extension)
  46. # Note: Xwd does not explicitly set an exit code, so you need to
  47. #    catch to results of the exec
  48. #
  49. proc CreateWindowDump { w fileName } {
  50.     set winId [winfo id $w]
  51.     set cmd "exec xwd -id $winId -out $fileName.xwd"
  52.     catch $cmd msg
  53. }
  54.