Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* svg.h*/
- /*
- * A simple svg header for c++
- * */
- #ifndef _svg_h
- #define _svg_h
- #include <iostream>
- using namespace std;
- void SVGhead(){
- cout << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n";
- cout << "<svg\n ";
- cout << " xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n";
- cout << " xmlns:cc=\"http://creativecommons.org/ns#\"\n";
- cout <<" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n";
- cout << " xmlns:svg=\"http://www.w3.org/2000/svg\"\n";
- cout << " xmlns=\"http://www.w3.org/2000/svg\"\n";
- cout << " id=\"svg8\"\n";
- cout << " version=\"1.1\"\n";
- cout << " viewBox=\"0 0 300 300\"\n";
- cout << " height=\"100%\"\n";
- cout << " width=\"100%\">\n";
- }
- void circle(int x,int y,int r){ //x,y,radius
- cout <<" <circle cx=\""<< x << "\" ";
- cout <<" cy=\"" << y << "\" ";
- cout <<" r=\""<< r << "\" ";
- cout << " stroke=\"red\" ";
- cout << " stroke-width=\"0.1\" ";
- cout << " fill=\"none\" />" ;
- }
- void square(int x,int y,int side){ // x,y,side
- cout << " <rect \n";
- cout << " style=\"fill:#f8ff30; \n";
- cout << " fill-opacity:0;\n";
- cout << " stroke:#ff0000;\n";
- cout << " stroke-width:0.26458333;\n";
- cout << " stroke-miterlimit:4;\n";
- cout << "stroke-dasharray:none;\n";
- cout << "stroke-opacity:1\n";
- //cout << "id=\"rect815\"\n";
- cout << "width=\""<< side<< "\" \n";
- cout << "height=\""<< side<<"\"\n";
- cout << "x=\""<< x <<"\"\n";
- cout << "y=\"" << y <<"\"\n";
- cout << "/>\n";
- }
- void SVGend(){
- cout << "</svg>" << endl; //end svg
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement