6 System.loadLibrary("simple");
7 } catch (UnsatisfiedLinkError e) {
8 System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
13 public static void main(String argv[]) {
15 // Draw some simple shapes
16 System.out.println( "Drawing some basic shapes" );
18 SWIGTYPE_p_ColorMap cmap = simple.new_ColorMap(null);
19 SWIGTYPE_p_FrameBuffer f = simple.new_FrameBuffer(400,400);
22 simple.FrameBuffer_clear(f,(short)simple.BLACK);
25 simple.FrameBuffer_box(f,40,40,200,200,(short)simple.RED);
28 simple.FrameBuffer_circle(f,200,200,40,(short)simple.BLUE);
31 simple.FrameBuffer_line(f,10,390,390,200, (short)simple.GREEN);
33 // Write an image out to disk
35 simple.FrameBuffer_writeGIF(f,cmap,"image.gif");
36 System.out.println( "Wrote image.gif" );
38 simple.delete_FrameBuffer(f);
39 simple.delete_ColorMap(cmap);