topical media & game development

talk show tell print

graphic-processing-site-examples-Topics-File-IO-SaveOneImage-SaveOneImage.pde / pde



  
Save One Image The save() function allows you to save an image from the display window. In this example, save() is run when a mouse button is pressed. The image "line.tif" is saved to the same folder as the sketch's program file.

  
  
  void setup() 
  {
    size(200, 200);
  }
  
  void draw() 
  {
    background(204);
    line(0, 0, mouseX, height);
    line(width, 0, 0, mouseY);
  }
  
  void mousePressed() 
  {
    save("line.tif");
  }
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.