Path: utzoo!attcan!uunet!lll-winken!ames!pasteur!ucbvax!GATEWAY.MITRE.ORG!alexis%yummy From: alexis%yummy@GATEWAY.MITRE.ORG Newsgroups: comp.windows.news Subject: Forcing NeWS *NOT* to interpolate colors canvases Message-ID: <8901171519.AA06104@marzipan.mitre.org> Date: 17 Jan 89 16:33:30 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 42 Is there a way to stop NeWS from interpolate between pixels of a color canvas? I'm trying to draw something which I'd like to look like a bunch of colored squares. If I use a color canvas, NeWS is "helpful" and spends lots of time and energy interpolating. It's all very pretty ... but it's very slow and not what I want. You end up with star-bursts and colors where you never put them. As a quick example try running the following. It's quite pretty, but first time you try it make the window SMALL (as in postage stamp size). It's most interesting big, but it tends to break due to the time it takes to compute (my sun 4 can do about a 5x5). %%%%%%%%%%%% Try This Sample Code, It's Fun And Easy %%%%%%%%%%%%% #!/usr/NeWS/bin/psh /img 16 16 24 [16 0 0 -16 0 16] {random 0.5 gt {(\000)} {(\377)} ifelse} buildimage def /win framebuffer /new DefaultWindow send def { /PaintClient { ClientCanvas setcanvas clippath pathbbox scale pop pop img imagecanvas } def } win send /reshapefromuser win send /map win send %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Please don't tell me to: a) make a canvas the same size that I'm going to display [one of the whole reasons for using NeWS is so the window can be resized.] b) draw actual squares [that's what I do now -- it works, but for large images it's even slower than the above.] c) go editing NeWS or any other fool thing. I just want a way to turn off this interpolation "feature" occasionally. Alexis P. Wieland MITRE Corporation 7525 Colshire Dr. McLean, VA 22102 (703) 883-7476 alexis%yummy@gateway.mitre.org