Article View: comp.lang.postscript
Article #5725Re: help with a def including an image
From: Allen B
Date: Wed, 18 Nov 1992 18:24
Date: Wed, 18 Nov 1992 18:24
47 lines
1563 bytes
1563 bytes
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
Technical Details
Message-ID:
<BxxCH4.D6A@mentor.cc.purdue.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!mentor.cc.purdue.edu!newsReferences:
<2157@shaman.wv.tek.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript Path: arc1-ca.pugleaf.net!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