🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #10112

Re: postscript to rasterfile? (Scout's paint2.ps)

#10112
From: Don Hopkins
Date: Sat, 07 Jan 1989 08:00
73 lines
2629 bytes
Here's a simple NeWS program that you can use to grab regions of the
screen and write out raster files, to the file "/tmp/clip".

	-Don

%!
%
% Date: Wed, 21 Sep 88 10:30:16 EDT
% To: NeWS-makers@brillig.umd.edu
% Subject: Re: Color PostScript screendump for NeWS
% From: campfire!scout@sun.com  (David LaVallee)
% 
% Here's a little cut and paste and sketch program that uses the file
% /tmp/clip as its storage. NeWS stores the "clip" as a run-length
% encoded sun raster file (B+W or Color).
% 
% I have used this program to clip stuff for B+W and color raster
% printers, on a Sun with TRANSCRIPT software this is one way to
% print the rasterfile to a LaserWriter:
% 
% /usr/lib/rasfilters/convert.2 /tmp/clip | pssun | lpr
% 
% --Scoutly

%%NeWS1.1
%%author:	David A. LaVallee
%%title:	paint2

[/x0 /y0 /x1 /y1 /x /y /win /can] {null def} forall
/win framebuffer /new DefaultWindow send def
/reshapefromuser win send
{   /ClientMenu [
        (cut)
    {
        framebuffer createoverlay setcanvas getwholerect waitprocess aload pop
        framebuffer setcanvas points2rect rectpath (/tmp/clip) writescreen
    }
        (paste)
    {
        can createoverlay setcanvas getwholerect waitprocess aload pop
        can setcanvas points2rect gsave 4 2 roll translate scale
        {(/tmp/clip) readcanvas imagecanvas} stopped {pop} if grestore
    }
    ] /new DefaultMenu send def
} win send
/map win send
/can win /ClientCanvas get def
can /Retained true put

/paintit {0 setgray x1 y1 moveto x y lineto stroke} def

/setxy {
	/x1 x store /y1 y store
	begin /x XLocation store /y YLocation store end
} def

/paintbrush {
10 dict begin
    currentcursorlocation /y exch store /x exch store
    /x0 x store /y0 y store
    /x1 x store /y1 y store
    paintit
    [   null {currentprocess killprocess} /UpTransition null eventmgrinterest
	MouseDragged {setxy paintit} null null eventmgrinterest
    ] forkeventmgr pop
end
} def

/PaintEventMgr [
        PointButton {
                can setcanvas paintbrush
        } /DownTransition can eventmgrinterest
] forkeventmgr def
Technical Details
Message-ID: <8901030924.AA13156@brillig.umd.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!ames!husc6!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!ames!husc6!rice!sun-spots-request
From: don@brillig.umd.edu (Don Hopkins)
Newsgroups: comp.sys.sun
Subject: Re: postscript to rasterfile? (Scout's paint2.ps)
Message-ID: <8901030924.AA13156@brillig.umd.edu>
Date: 7 Jan 89 08:00:37 GMT
Sender: usenet@rice.edu
Organization: Sun-Spots
Lines: 73
Approved: Sun-Spots@rice.edu
Original-Date: Tue, 3 Jan 89 04:24:46 EST
X-Sun-Spots-Digest: Volume 7, Issue 92, message 9 of 11