PageRenderTime 26ms CodeModel.GetById 17ms app.highlight 6ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/ttn-post-libtool-1-4-3-upgrade/SWIG/Examples/GIFPlot/Guile/simple/runme.scm

#
Lisp | 30 lines | 12 code | 11 blank | 7 comment | 0 complexity | fa71b80b7cf40fbd3ff6f21c3ff87ca4 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1;;; Draw some simple shapes
 2
 3;; Use the wrapped GIFPlot library
 4(use-modules (simple))
 5
 6(display "Drawing some basic shapes\n")
 7
 8(define cmap (new-ColorMap))
 9(define f (new-FrameBuffer 400 400))
10
11;; Clear the picture
12(FrameBuffer-clear f (BLACK))
13
14;; Make a red box
15(FrameBuffer-box f 40 40 200 200 (RED))
16
17;; Make a blue circle
18(FrameBuffer-circle f 200 200 40 (BLUE))
19
20;; Make green line
21(FrameBuffer-line f 10 390 390 200 (GREEN))
22
23;; Write an image out to disk
24
25(FrameBuffer-writeGIF f cmap "image.gif")
26(display "Wrote image.gif\n")
27
28(delete-FrameBuffer f)
29(delete-ColorMap cmap)
30