We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to load an SVG file (saved from Illustrator) to be visible in Processing. Below is the code I use for this, however, it doesn't work. The SVG file is inside the data folder. Thank you in advance for helping.
PShape logo;
void setup() { size(800, 800); logo = loadShape("logo01.svg"); }
void draw() { background(255); shape(logo); }
Answers
how so?
Hi, thanks for respondng. It doesn't work, as it displays an empty window. I tried the same with a JPG image and it loads just fine, so I understand something must be wrong with the format of my SVG file, right?
can you post the svg file? assuming it's not too large
it should just be xml, you can format it as code (highlight the source, press ctrl-o)
failing that, can you upload it somewhere and link to it?
Thanks, I'm enclosing the code of the svg file below:
there's a lot of illustrator guff in that file. it says it's ignoring the switch tag, which is annoying because everything is inside the switch tag!
this works:
but having to edit out all that stuff every time you modify the file won't be fun.
oh, wow! Thank you for analysing all this. What I don't get is, since this is a simple shape, nothing overly complicated, why the SVG saves itself in a way that complicates all.. I'm not so advanced in Processing, so it's even harder for me to understand all this, but I'll try to edit the code and see whether I can get a hang of it :) Thank you for assisting, I appreciate all your help!
adobe illustrator 8)