[comp.windows.news] writescreen/readcanvas failure

tom@tubopal.UUCP (Thomas Sander) (06/07/89)

% Hello NeWS-Users,

% The following little program demonstrates a failure of the
% 'writescreen/readcanvas' operator, we cannot fix.


%-----cut here-----cut here-----cut here-----cut here-----cut here-----cut here

gsave
    framebuffer setcanvas
    gsave 80 280 100 200 rectpath 1 setgray fill grestore
    100 300 translate 0 0 moveto
    /yp showicon
    0 0 64 64 rectpath
    (test1.pic) writescreen 
    (test1.pic) readcanvas        % 1st time that we use readcanvas
    0 100  translate
    64 64 scale
    imagecanvas
grestore

gsave
    framebuffer setcanvas
    gsave 180 280 100 300 rectpath 1 setgray fill grestore
    200 300 translate 0 0 moveto
    /moose showicon
    0 0 64 64 rectpath
    (test3.pic) writescreen
    (screendump -x 200 -y 536 -Y 64 -X 64 > test2.pic) forkunix
    0.1 sleep
    (test2.pic) readcanvas        % 2nd time that we use readcanvas
    gsave
        0 100  translate
        64 64 scale
        imagecanvas
    grestore
    (test3.pic) readcanvas        % 3rd time that we use readcanvas
    0 200  translate
    64 64 scale
    imagecanvas
grestore

%-----cut here-----cut here-----cut here-----cut here-----cut here-----cut here


% The 3rd 'readcanvas' operator failes with an 'invalidaccess' error.
% This error occurs only with some Sun-Icons (e. g. /moose or /artist).
% With the icon /artist the 'writescreen' operator produces an empty file,
% with the /moose icon it produces a 'run-length byte encoded image', which
% cannot be interpreted by 'readcanvas'.

% The standard raster format files produced by the 'screendump' program
% never bother the 'readcanvas' operator. Why do the 'run-length byte encoded
% images', produced by the 'writescreen' operator.
% Who can help ?
% Thanks in advance,    Tom
%-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%Tom Sander                                     TU Berlin FB-20 Sekr. FR 5-6
%UUCP: ...!unido!tubopal!tom                    Franklinstr. 28/29
%BITNET: tom%tubopal@db0tui11                   D 1000 Berlin (West) 10
-- 
%-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%Tom Sander                                     TU Berlin FB-20 Sekr. FR 5-6
%UUCP: ...!unido!tubopal!tom                    Franklinstr. 28/29
%BITNET: tom%tubopal@db0tui11                   D 1000 Berlin (West) 10