2 #include <Elementary.h>
9 static uint32_t buffer[WIDTH * HEIGHT];
14 //Initialize TizenVG Engine
17 //Initialize TizenVG Engine
21 auto canvas = tvg::SwCanvas::gen();
22 canvas->target(buffer, WIDTH, WIDTH, HEIGHT);
25 auto shape1 = tvg::Shape::gen();
26 shape1->appendRect(50, 50, 200, 200, 0);
27 shape1->fill(50, 50, 50, 255);
28 shape1->stroke(255, 255, 255, 255); //color: r, g, b, a
29 shape1->stroke(tvg::StrokeJoin::Bevel); //default is Bevel
30 shape1->stroke(10); //width: 10px
32 canvas->push(move(shape1));
35 auto shape2 = tvg::Shape::gen();
36 shape2->appendRect(300, 50, 200, 200, 0);
37 shape2->fill(50, 50, 50, 255);
38 shape2->stroke(255, 255, 255, 255);
39 shape2->stroke(tvg::StrokeJoin::Round);
42 canvas->push(move(shape2));
45 auto shape3 = tvg::Shape::gen();
46 shape3->appendRect(550, 50, 200, 200, 0);
47 shape3->fill(50, 50, 50, 255);
48 shape3->stroke(255, 255, 255, 255);
49 shape3->stroke(tvg::StrokeJoin::Miter);
52 canvas->push(move(shape3));
55 auto shape4 = tvg::Shape::gen();
56 shape4->appendCircle(150, 450, 100, 100);
57 shape4->fill(50, 50, 50, 255);
58 shape4->stroke(255, 255, 255, 255);
61 canvas->push(move(shape4));
64 auto shape5 = tvg::Shape::gen();
65 shape5->appendCircle(400, 450, 100, 100);
66 shape5->fill(50, 50, 50, 255);
67 shape5->stroke(255, 255, 255, 255);
70 canvas->push(move(shape5));
73 auto shape6 = tvg::Shape::gen();
74 shape6->appendCircle(650, 450, 100, 100);
75 shape6->fill(50, 50, 50, 255);
76 shape6->stroke(255, 255, 255, 255);
79 canvas->push(move(shape6));
85 //Terminate TizenVG Engine
90 win_del(void *data, Evas_Object *o, void *ev)
96 int main(int argc, char **argv)
100 //Show the result using EFL...
101 elm_init(argc, argv);
103 Eo* win = elm_win_util_standard_add(NULL, "TizenVG Test");
104 evas_object_smart_callback_add(win, "delete,request", win_del, 0);
106 Eo* img = evas_object_image_filled_add(evas_object_evas_get(win));
107 evas_object_image_size_set(img, WIDTH, HEIGHT);
108 evas_object_image_data_set(img, buffer);
109 evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
110 evas_object_show(img);
112 elm_win_resize_object_add(win, img);
113 evas_object_geometry_set(win, 0, 0, WIDTH, HEIGHT);
114 evas_object_show(win);