home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / postscri / 5595 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.5 KB  |  59 lines

  1. Newsgroups: comp.lang.postscript
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!mentor.cc.purdue.edu!news
  3. From: ab@nova.cc.purdue.edu (Allen B)
  4. Subject: Re: help with a def including an image
  5. Message-ID: <BxxCH4.D6A@mentor.cc.purdue.edu>
  6. Sender: news@mentor.cc.purdue.edu (USENET News)
  7. Organization: Purdue University
  8. References: <2157@shaman.wv.tek.com>
  9. Date: Wed, 18 Nov 1992 18:24:39 GMT
  10. Lines: 47
  11.  
  12. In article <2157@shaman.wv.tek.com> andrew@frip.WV.TEK.COM (Andrew Klossner)  
  13. writes:
  14. > > /mypic {
  15. > >    ...
  16. > >    {currentfile picstr readhexstring pop}
  17. > >    ...
  18. > > FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
  19. > >    ...
  20. > > } def
  21. > You can't do it this way.  "readhexstring" reads from the file, not
  22. > from the procedure body.
  23.  
  24. Right.  If I have an image I use a lot, I put it in an external
  25. file and run it.  I won't suggest that to you, though,
  26. 'cause I usually get flamed for it. :-) 
  27.  
  28. The image operator takes an arbitrary executable array. 
  29. You don't need to use a read to get the data.  You could get it
  30. from an array or a string.  If it's really big, you might
  31. have trouble doing that, but that's what files are for. :-(  
  32.  
  33. Somebody probably already suggested it, but you could
  34. try using a binary (hex) string directly: 
  35.  
  36. %!
  37. /logo
  38. {
  39.     8 8 1
  40.     [ 8 0 0 -8 0 8 ]
  41.     { <007e7e66667e7e00> }
  42.     image
  43. } def
  44.  
  45. gsave
  46. 100 100 translate
  47. 72 dup scale
  48. logo
  49. grestore
  50.  
  51. gsave
  52. 200 150 translate
  53. 80 60 scale
  54. logo
  55. grestore
  56.  
  57. showpage
  58.