Skip to content

Instantly share code, notes, and snippets.

@jellea
Last active August 29, 2015 14:15
Show Gist options
  • Save jellea/a62477d5a454aedb89ed to your computer and use it in GitHub Desktop.
Save jellea/a62477d5a454aedb89ed to your computer and use it in GitHub Desktop.
import org.philhosoft.p8g.svg.P8gGraphicsSVG;
/*
Show simultaneous on-screen display and SVG export, and how the viewport clips the graphics.
Also a simple text test.
*/
void setup()
{
// With screen display
size(500, 500);
noLoop(); // No animation
// Start the recording
beginRecord(P8gGraphicsSVG.SVG, "AutoCrop.svg");
}
void draw()
{
background(#FFFFFF);
stroke(#000000);
ellipse(150, 150, 150, 150);
// End the recording, mandatory to save the file
endRecord();
println("Done");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment