example: modify the tvg example to plot all of the files
authorMira Grudzinska <m.grudzinska@samsung.com>
Tue, 26 Oct 2021 00:21:07 +0000 (02:21 +0200)
committerHermet Park <chuneon.park@samsung.com>
Tue, 26 Oct 2021 04:13:00 +0000 (13:13 +0900)
Change-Id: I63908b03d0276aa78bc8a266c62a89c98f9634c1

src/examples/Tvg.cpp

index 1f57911..1cde659 100644 (file)
@@ -27,8 +27,9 @@
 /* Drawing Commands                                                     */
 /************************************************************************/
 
-#define NUM_PER_LINE 6
-#define SIZE (WIDTH/NUM_PER_LINE)
+#define NUM_PER_ROW 7
+#define NUM_PER_COL 6
+#define SIZE (WIDTH/NUM_PER_ROW)
 
 static int count = 0;
 
@@ -48,7 +49,7 @@ void tvgDirCallback(const char* name, const char* path, void* data)
     if (picture->load(buf) != tvg::Result::Success) return;
 
     picture->size(SIZE, SIZE);
-    picture->translate((count % NUM_PER_LINE) * SIZE, SIZE * (count / NUM_PER_LINE));
+    picture->translate((count % NUM_PER_ROW) * SIZE, (count / NUM_PER_ROW) * (HEIGHT / NUM_PER_COL));
 
     pictures.push_back(move(picture));