We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi there, Can anyone please let me know if there is a reference for the library processing.svg? Thanks Paul
It functions the same as the PDF library.
import processing.svg.*; PGraphics pgDrawing; PShape bg; void setup() { size(400, 400); background(255); pgDrawing = createGraphics(400, 400, SVG, "test.svg"); pgDrawing.beginDraw(); pgDrawing.background(255); pgDrawing.stroke(0); pgDrawing.strokeWeight(4); drawEllipses(); pgDrawing.dispose(); pgDrawing.endDraw(); bg = loadShape("test.svg"); } void draw() { shape(bg, 0, 0); noLoop(); } void drawEllipses() { for (int i=0; i<10; i++) { pgDrawing.ellipse(random(0, width), random(0, height), 10, 10); } }
Probably a bit late, but you need to call dispose after endDraw:
dispose
endDraw
pgDrawing.endDraw(); pgDrawing.dispose();
Answers
It functions the same as the PDF library.
Probably a bit late, but you need to call
dispose
afterendDraw
:pgDrawing.endDraw(); pgDrawing.dispose();