Search processing.org:

Reference for Processing (BETA) version 0135+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name

### SVG

Examples

    import processing.candy.*;
    import processing.xml.*;

    SVG m;

    void setup(){
      size(400,400);
      // The file "moo.svg" must be in the data folder
      // of the current sketch to load successfully
      m = new SVG(this, "moo.svg");
      m.drawMode(CENTER);
    }

    void draw(){
      m.draw(width/2, height/2);
    }

Description | This class stores graphics in the SVG vector format and can draw them to the screen. SVG stands for Scalar Vector Graphics, a portable graphics format. Most modern media software can view SVG files, including Firefox, Adobe products, etc. You can use software such as Inkscape or Illustrator to create and edit SVG files before they are loaded.

Methods

draw() | Draws the SVG to the screen
drawMode() | Changes the way the parameters to draw() are interpreted
ignoreStyles() | Overrides SVG-set styles and uses PGraphics styles and colors
get() | Get's a particular element based on its SVG ID
print() | Prints out the SVG document

Constructor

    SVG(parent, filename)

Parameters

parent | PApplet: typically use "this"
width | String: name of the file to load

Usage | Web & Application

Updated on February 09, 2008 04:38:52pm PST