import java.awt.*; import java.awt.event.*; import java.io.*; public class DisplayResults { public static void main(String argv[]) { int w, h; if (argv.length < 3) { System.out.println("Usage: java DisplayResults width height filename"); System.exit(0); w = 2; h = 2; // Yes, I know. But javac likes to complain about // possibly not initialized variables. } else { w = Integer.parseInt(argv[0]); h = Integer.parseInt(argv[1]); if (w < 100) w = 100; if (h < 100) h = 100; w += 60; h += 60; } Frame display; display = new Frame("Rendered Image"); System.out.println("Size is " + w + " x " + h); display.setSize(w, h); display.show(); display.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); Graphics g = display.getGraphics(); //Dimension size = display.getSize(); //int w2 = size.width; //int h2 = size.height; //Image backImage = display.createImage(w2, h2); //Graphics g2 = backImage.getGraphics(); try { String infilename = argv[2]; ObjectInputStream filein = new ObjectInputStream( new FileInputStream(infilename)); Scanline picture; Color thisColor = Color.yellow; Color prevColor = Color.green; int leftEnd = 0, pictureLength = 100; // Print out each line. This algorithm speeds things up // by drawing a line if it finds a span of identical colors, // rather than drawing every pixel. // for (int j=0; j<40; j++) int j = 0; while(true) { picture = (Scanline) filein.readObject(); pictureLength=picture.length; for (int i=0; i