-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
18 lines (14 loc) · 700 Bytes
/
Copy pathmain.cpp
File metadata and controls
18 lines (14 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "SVG.h"
// note: C++11 required
int main(int argc, char* argv[]) {
SVG::SVGWriter a("file.svg", 800, 600);
a.writeHeader();
a.drawRect(50,50,300,400,SVG::Colour(255,0,0));
a.drawText(100, 100, "hello world", SVG::Colour(0,255,255), SVG::Colour(255,255,0), 3, "Verdana", 50);
a.drawPolyline({50,400,8,103},{400,50,100,30},"stroke: #000000; stroke-width: 10; fill: none;");
a.drawPolygon({{0,40},{40,40},{40,80},{80,80},{80,120},{120,120},{120,160}}, "fill: #f9f38c; stroke: #d07735; stroke-width: 6;");
for (int i = 10; i < 300; i += 5) {
a.inject("<text x=\"100\" y=\"100\" transform=\"rotate("+std::to_string(i)+")\">HELLO WORLD</text>");
}
a.writeFooter();
}