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:
Hermet Park 2024-01-22 18:57:22 +09:00 committed by Jinny You
parent 67d8d9f36c
commit adf12801c9

View file

@ -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;
} }