Images as a background in NeWS

Martin J. Dellwo dellwo at montreal.scs.uiuc.EDU
Sat Jun 8 08:21:39 AEST 1991


Matthew White writes:
	
>	Is there an easy way of putting an image onto the background when
>	running NeWS on the SGI ?
>...	
>	3) Write a Postscript program to draw the image (like the stuff in
>		   /usr/NeWS/lib/roots.ps)
>			Belch, please please let there be an easier way!
>...	

I just tried this and it works for the given image file (but I know
nothing about image file formats and what you might do for other
type...).  I'm running 3.3.2

Place the following in user.ps in your home directory:

  /PaintRoot {
	gsave framebuffer setcanvas clippath pathbbox scale pop pop
	(saturn.im8) readcanvas imagecanvas
	grestore
  } dup /PlainPaintRoot exch store store
  PaintRoot

The image file 'saturn.im8' is from the demos in /usr/NeWS/smi, I
copied it to my home directory but you can invoke it by giving any
full pathname in the parentheses.

The default procedure is just this:

  /PaintRoot {
        .5 .62 .75 setrgbcolor
        clipcanvaspath fill
  } dup /PlainPaintRoot exch store store
  PaintRoot

To cause either of these to take effect while within NeWS just put the
code in a separate file, eg. root.file, then give the command:
cat root.file | psh

And look! no belching...

Martin Dellwo
dellwo at ottawa.scs.uiuc.edu



More information about the Comp.sys.sgi mailing list