mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
examples/GifSaver: updated with a background usage
This commit is contained in:
parent
561a6d8935
commit
1fddcd3af2
1 changed files with 8 additions and 0 deletions
|
@ -55,6 +55,14 @@ void exportGif()
|
||||||
picture->size(800, 800);
|
picture->size(800, 800);
|
||||||
|
|
||||||
saver = tvg::Saver::gen();
|
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) {
|
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;
|
cout << "Problem with saving the json file. Did you enable Gif Saver?" << endl;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue