import com.stevesoft.phreida.*; import java.awt.*; import java.io.*; import java.net.*; public class Test4 { public static void main(String[] args) throws Exception { // Create the graphics object. Page size is about the // same as a paperback novel. System.setErr(new PrintStream(new FileOutputStream("err.out"),true)); PGraphics pg = new PGraphics("test4.pdf",0,0,300,460); Toolkit tk = Toolkit.getDefaultToolkit(); URL url = Test4.class.getResource("onintro.gif"); Image im = tk.getImage(url); // The ImageObserver parameter isn't required here. // But it won't hurt either. pg.drawImage(im,65,95,null); int del = 5; int radius = 50; int x = 100, y = 100; for(int i=0;i <= 360;i+=30) { radius += 2*del; y -= del; x -= del; pg.setColor(Color.green); pg.drawArc(x,y,radius,radius,i,300); pg.setColor(Color.blue); pg.drawArc(x,y,radius,radius,i+300,60); } // Finish pg.dispose(); // writes out file System.exit(0); // Graphics thread is running still } }