mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
examples/gif: revise the sample.
60fps takes a bit long time for our daily testing. Removed it for the speed.
This commit is contained in:
parent
67d8d9f36c
commit
adf12801c9
1 changed files with 0 additions and 25 deletions
|
@ -44,31 +44,6 @@ void exportGif()
|
||||||
}
|
}
|
||||||
saver->sync();
|
saver->sync();
|
||||||
cout << "Successfully exported to test.gif." << endl;
|
cout << "Successfully exported to test.gif." << endl;
|
||||||
|
|
||||||
animation = tvg::Animation::gen();
|
|
||||||
picture = animation->picture();
|
|
||||||
if (picture->load(EXAMPLE_DIR"/walker.json") != tvg::Result::Success) {
|
|
||||||
cout << "Lottie is not supported. Did you enable Lottie Loader?" << endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
picture->size(800, 800);
|
|
||||||
|
|
||||||
saver = tvg::Saver::gen();
|
|
||||||
|
|
||||||
//set a white opaque background
|
|
||||||
auto bg = tvg::Shape::gen();
|
|
||||||
bg->fill(255, 255, 255, 255);
|
|
||||||
bg->appendRect(0, 0, 800, 800);
|
|
||||||
|
|
||||||
saver->background(std::move(bg));
|
|
||||||
|
|
||||||
if (saver->save(std::move(animation), "./test_60fps.gif", 100, 60) != tvg::Result::Success) {
|
|
||||||
cout << "Problem with saving the json file. Did you enable Gif Saver?" << endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
saver->sync();
|
|
||||||
cout << "Successfully exported to test_60fps.gif." << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue