PageRenderTime 16ms CodeModel.GetById 11ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/rel-1-3-15/SWIG/Examples/GIFPlot/Python/simple/runme.py

#
Python | 27 lines | 12 code | 9 blank | 6 comment | 0 complexity | 404a6161ef2a998875c8d9390ce1e38f MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1# Draw some simple shapes
 2print "Drawing some basic shapes"
 3import simple
 4
 5cmap = simple.new_ColorMap()
 6f    = simple.new_FrameBuffer(400,400)
 7
 8# Clear the picture
 9simple.FrameBuffer_clear(f,simple.BLACK)
10
11# Make a red box
12simple.FrameBuffer_box(f,40,40,200,200,simple.RED)
13
14# Make a blue circle
15simple.FrameBuffer_circle(f,200,200,40,simple.BLUE)
16
17# Make green line
18simple.FrameBuffer_line(f,10,390,390,200, simple.GREEN)
19
20# Write an image out to disk
21
22simple.FrameBuffer_writeGIF(f,cmap,"image.gif")
23print "Wrote image.gif"
24
25simple.delete_FrameBuffer(f)
26simple.delete_ColorMap(cmap)
27