[comp.sys.sgi] Images as a background in NeWS

matthew@cs.ed.ac.uk (Matthew White) (06/08/91)

I may be missing something blindingly obvious here but ....

Is there an easy way of putting an image onto the background when
running NeWS on the SGI ?

Some possibilities are :
	1) Use X and xloadimage / xv / whatever
		Until 4.0 is available I don't really think of this as 
		an option :-(
	2) Write a wee GL program to use imakebackground and draw the image
		But this won't make use of knowledge about which bits of
		the screen need to be redrawn (unless I am missing
		something else).
	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!

Anybody know of a nice little program which will have the functionality
of xloadimage -onroot but which will work within NeWS ?

Matthew White
Edinburgh Parallel Computing Centre
e_mail: matthew@epcc.edinburgh.ac.uk

dellwo@montreal.scs.uiuc.EDU ("Martin J. Dellwo") (06/08/91)

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@ottawa.scs.uiuc.edu