PageRenderTime 47ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1.3.35/Examples/GIFPlot/Pike/simple/runme.pike

#
Unknown | 30 lines | 21 code | 9 blank | 0 comment | 0 complexity | b97b84e416a8366ec058ff8ed0785e02 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. int main()
  2. {
  3. // Draw some simple shapes
  4. write("Drawing some basic shapes\n");
  5. .simple.ColorMap cmap = .simple.new_ColorMap();
  6. .simple.FrameBuffer f = .simple.new_FrameBuffer(400, 400);
  7. // Clear the picture
  8. .simple.FrameBuffer_clear(f, .simple.BLACK);
  9. // Make a red box
  10. .simple.FrameBuffer_box(f, 40, 40, 200, 200, .simple.RED);
  11. // Make a blue circle
  12. .simple.FrameBuffer_circle(f, 200, 200, 40, .simple.BLUE);
  13. // Make green line
  14. .simple.FrameBuffer_line(f, 10, 390, 390, 200, .simple.GREEN);
  15. // Write an image out to disk
  16. .simple.FrameBuffer_writeGIF(f, cmap, "image.gif");
  17. write("Wrote image.gif\n");
  18. .simple.delete_FrameBuffer(f);
  19. .simple.delete_ColorMap(cmap);
  20. return 0;
  21. }