topical media & game development

talk show tell print

graphic-processing-site-examples-Libraries-PDF-Export-MultipleFrames-MultipleFrames.pde / pde



  
Multiple Frames. Saves one PDF document of many frames drawn to the screen. Starts the file when the mouse is pressed and end the file when the mouse is released.

  
  
  import processing.pdf.*;
  
  void setup() {
    size(600, 600);
    frameRate(24);
    background(255);
  }
  
  void draw() {
    stroke(0, 20);
    strokeWeight(20.0);
    line(mouseX, 0, width-mouseY, height);
  }
  
  void mousePressed() {
    beginRecord(PDF, "Lines.pdf"); 
    background(255);
  }
  
  void mouseReleased() {
    endRecord();
    background(255);
  }
  
  


(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.