Last updated 9 May 2009. Created on 23 July 2007.
Edited by danielb, LeeHunter, snufkin, add1sun. Log in to edit this page.

The Drawing project consists of these packages:

  • The Drawing API module; this contains generic functions in order to parse canvas arrays in a similar way to Forms API.
  • The Drawing SVG toolkit, which contains the functions to process the canvas shapes and theme it into SVG output.
  • The Drawing GD toolkit (currently 6.x only), which contains the functions to process the canvas shapes and generate png, gif, and jpg images.
  • The Drawing Demo module; contains a few canvases to test out and study.
  • The Drawing Graph module; provides functions to easily create graphs.

The basic idea of the Drawing API is that developers can create a canvas builder function (analogous to a form builder function) which returns an array of canvas groups and shapes (similar to form elements). The canvas array can then be processed into an image with drawing_get_canvas('canvas_id'); where canvas_id is the name of the canvas builder function.

The Drawing API documentation below contains the syntax by which graphics can be created.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.