Cant draw svg using ofxSVG


#1

Hello ! this may be a silly question.

I´ve been trying to draw a svg file into openframeworks but I just can´t seem to get it done. Nothing shows up.

i´ve already load ofxsvg addon into my proyect.

This is my code :

ofApp.h :

#pragma once

#include "ofMain.h"
#include "ofxSvg.h"
class ofApp : public ofBaseApp{

	public:
		void setup();		
		void draw();

		ofShader sh;
		ofImage img;
		
		float size; 
		ofVec2f pos;
		ofxSVG heart;
};

ofApp.cpp :

#include "ofApp.h"
void ofApp::setup(){
	ofSetWindowShape(600, 600);	
	heart.load("SVG/heart.svg");
}
void ofApp::draw(){
	heart.draw();
}

Is there something obvious that I´ve may be missing ?


#2

Are the examples for that addon working? which version of ofxSvg are you using?

Edit: I see now that you are probably referring to the addon that come with OF.
Are the svg examples working?

Try to set a color

#include "ofApp.h"
void ofApp::setup(){
	ofSetWindowShape(600, 600);	
	heart.load("SVG/heart.svg");
}
void ofApp::draw(){
        ofPushStyle();
        ofSetColor(255,0,0);
        heart.draw();
        ofPopStyle();
}

#3

Now its working.Tryed in a new clean sketch and it works, not sure why. . . thanks for the help !