home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.postscript
- 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
- From: ab@nova.cc.purdue.edu (Allen B)
- Subject: Re: help with a def including an image
- Message-ID: <BxxCH4.D6A@mentor.cc.purdue.edu>
- Sender: news@mentor.cc.purdue.edu (USENET News)
- Organization: Purdue University
- References: <2157@shaman.wv.tek.com>
- Date: Wed, 18 Nov 1992 18:24:39 GMT
- Lines: 47
-
- In article <2157@shaman.wv.tek.com> andrew@frip.WV.TEK.COM (Andrew Klossner)
- writes:
- > > /mypic {
- > > ...
- > > {currentfile picstr readhexstring pop}
- > > ...
- > > FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
- > > ...
- > > } def
- >
- > You can't do it this way. "readhexstring" reads from the file, not
- > from the procedure body.
-
- Right. If I have an image I use a lot, I put it in an external
- file and run it. I won't suggest that to you, though,
- 'cause I usually get flamed for it. :-)
-
- The image operator takes an arbitrary executable array.
- You don't need to use a read to get the data. You could get it
- from an array or a string. If it's really big, you might
- have trouble doing that, but that's what files are for. :-(
-
- Somebody probably already suggested it, but you could
- try using a binary (hex) string directly:
-
- %!
- /logo
- {
- 8 8 1
- [ 8 0 0 -8 0 8 ]
- { <007e7e66667e7e00> }
- image
- } def
-
- gsave
- 100 100 translate
- 72 dup scale
- logo
- grestore
-
- gsave
- 200 150 translate
- 80 60 scale
- logo
- grestore
-
- showpage
-