mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-04 22:03:29 -06:00
25 lines
490 B
C++
25 lines
490 B
C++
#include "Examples.h"
|
|
|
|
String file = "C:\\Demo.svg";
|
|
|
|
void SvgDemo(Painter& sw)
|
|
{
|
|
try {
|
|
if (FileExists(file))
|
|
ParseSVG(sw, LoadFileBOM(file), GetFileDirectory(file));
|
|
else {
|
|
sw.Scale(1./20);
|
|
sw.Text(200, 200, "File '" + file + "' not found", Font(Font::ARIAL, 400));
|
|
sw.Opacity(1);
|
|
sw.Stroke(1, Black());
|
|
sw.Fill(Black());
|
|
}
|
|
}
|
|
catch(XmlError e) {
|
|
LOG("SVG XML error: " + e);
|
|
}
|
|
}
|
|
|
|
INITBLOCK {
|
|
RegisterExample("Svg demo", SvgDemo);
|
|
}
|