DemoImport is an example project which can import other vector format files.
Shape importing example in C++: GlyphParser.cpp
void parseTrace(MgView* view, MgStorage* s)
{
if (s->readNode("T", -1, false)) {
MgShape *sp = view->getShapeFactory()->createShape(MgLines::Type());
MgLines *lines = (MgLines*)sp->shape();
for (int j = 0; s->readNode(NULL, j, false); j++) {
lines->addPoint(Point2d(s->readFloat("x", 0), s->readFloat("y", 0)));
s->readNode(NULL, j, true);
}
s->readNode("R", -1, true);
view->shapes()->addShapeDirect(sp);
}
}-
Cd the 'ios' folder of this project, then type
pod installorpod update --no-repo-update. -
Open
ios/DemoImport.xcworkspacein Xcode and run theDemoImportdemo app.
Alternatively, you can build as one of the following methods:
-
Cd the 'ios' folder of this project and type
./build.shor./build.sh -arch arm64to checkout and build libraries needed. -
Open
ios/DemoImport.xcworkspacein Xcode, then run theDemoImportdemo app.
Import the android/DemoImport project, then run the DemoImport demo app.
This is an open source LGPL 2.1 licensed project based on TouchVG project.
Contributors and sponsors are welcome. You may commit issues or pull requests on this Github site.