diff --git a/src/examples/PictureJpg.cpp b/src/examples/PictureJpg.cpp index 7f4e6c5d..0dc6d35c 100644 --- a/src/examples/PictureJpg.cpp +++ b/src/examples/PictureJpg.cpp @@ -31,6 +31,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) { if (!canvas) return; + auto opacity = 51; + //Load jpg file from path for (int i = 0; i < 5; ++i) { auto picture = tvg::Picture::gen(); @@ -41,6 +43,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) picture->translate(i* 150, i * 150); picture->rotate(30 * i); picture->size(200, 200); + picture->opacity(opacity + opacity * i); if (canvas->push(move(picture)) != tvg::Result::Success) return; } diff --git a/src/examples/PicturePng.cpp b/src/examples/PicturePng.cpp index d7ad2081..1cccf696 100644 --- a/src/examples/PicturePng.cpp +++ b/src/examples/PicturePng.cpp @@ -32,6 +32,8 @@ void tvgDrawCmds(tvg::Canvas* canvas) if (!canvas) return; //Load png file from path + auto opacity = 51; + for (int i = 0; i < 5; ++i) { auto picture = tvg::Picture::gen(); if (picture->load(EXAMPLE_DIR"/test.png") != tvg::Result::Success) { @@ -41,6 +43,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) picture->translate(i* 150, i * 150); picture->rotate(30 * i); picture->size(200, 200); + picture->opacity(opacity + opacity * i); if (canvas->push(move(picture)) != tvg::Result::Success) return; }