Xref: utzoo comp.graphics:13585 alt.graphics:1 Path: utzoo!utgpu!cs.utexas.edu!uwm.edu!rutgers!rochester!rit!cci632!sz From: sz@cci632.UUCP (Stephen Zehl) Newsgroups: comp.graphics,alt.graphics Subject: Help needed with Sun graphics routines. Keywords: Sun Message-ID: <40207@cci632.UUCP> Date: 28 Sep 90 20:32:37 GMT Organization: Computer Consoles Inc. an STC Company, Rochester, NY Lines: 56 - Hopefully this will be a simple question for someone out there who wouldn't mind taking a second to help out a new Sun user. I'm learning how to draw on my Sun IPC, and in fact I've had good luck at drawing my Mandelbrot sets using the package, except that calculating 30,000 x 30,000 pixels takes many many hours. I recently ran into the suntool graphics package and have been able to draw, but only in B/W. I'm having trouble learning how to manipulate the PIX_SRC bit map field to change colors. (Or at least this is how I believe I should do it.) Is the problem that I have to set up a color table first? How would I go about doing that? Below you will find a simple program I wrote to draw some lines, could someone modify it to make the lines colored. (I always learn best from examples.) Thanks a million. Steve. CCCC CCCC IIII Stephen Zehl Internet: cci632!sz@cs.rochester.EDU CC CC II Computer Consoles. Inc. or CC CC II Rochester, New York. Usenet: rutgers!rochester!cci632!sz CCCC CCCC IIII DISCLAIMER: I speak for myself, not for my employer. ---------------------------------------------------------------------------- #include #include main() { Frame frame; Canvas canvas; Pixwin *pw; int i; frame = window_create(NULL,FRAME,0); canvas = window_create(frame,CANVAS,0); pw=canvas_pixwin(canvas); for (i=5; i<=700; i+=7) { pw_vector(pw,5,i,700-i,5, PIX_SRC,1); pw_vector(pw,5,700-i,i,5, PIX_SRC,1); pw_vector(pw,i,5,700,i, PIX_SRC,1); pw_vector(pw,700,700-i,700-i,5, PIX_SRC,1); pw_vector(pw,700,i,700-i,700, PIX_SRC,1); pw_vector(pw,i,700,700,700-i, PIX_SRC,1); pw_vector(pw,5,700-i,700-i,700, PIX_SRC,1); pw_vector(pw,5,i,i,700, PIX_SRC,1); } window_main_loop(frame); exit(0); }