examples pictures: updated for case cover.

+ test opacity
This commit is contained in:
Hermet Park 2021-11-15 18:06:59 +09:00
parent c9377708a9
commit 5690f1ab0d
2 changed files with 6 additions and 0 deletions

View file

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

View file

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