2 #include <Elementary.h>
9 static uint32_t buffer[WIDTH * HEIGHT];
14 //Initialize TizenVG Engine
18 auto canvas = tvg::SwCanvas::gen();
19 canvas->target(buffer, WIDTH, WIDTH, HEIGHT);
22 auto shape1 = tvg::Shape::gen();
23 shape1->appendRect(50, 50, 200, 200, 0);
24 shape1->fill(50, 50, 50, 255);
25 shape1->stroke(255, 255, 255, 255); //color: r, g, b, a
26 shape1->stroke(tvg::StrokeJoin::Bevel); //default is Bevel
27 shape1->stroke(10); //width: 10px
29 canvas->push(move(shape1));
32 auto shape2 = tvg::Shape::gen();
33 shape2->appendRect(300, 50, 200, 200, 0);
34 shape2->fill(50, 50, 50, 255);
35 shape2->stroke(255, 255, 255, 255);
36 shape2->stroke(tvg::StrokeJoin::Round);
39 canvas->push(move(shape2));
42 auto shape3 = tvg::Shape::gen();
43 shape3->appendRect(550, 50, 200, 200, 0);
44 shape3->fill(50, 50, 50, 255);
45 shape3->stroke(255, 255, 255, 255);
46 shape3->stroke(tvg::StrokeJoin::Miter);
49 canvas->push(move(shape3));
52 auto shape4 = tvg::Shape::gen();
53 shape4->appendCircle(150, 450, 100, 100);
54 shape4->fill(50, 50, 50, 255);
55 shape4->stroke(255, 255, 255, 255);
58 canvas->push(move(shape4));
61 auto shape5 = tvg::Shape::gen();
62 shape5->appendCircle(400, 450, 100, 100);
63 shape5->fill(50, 50, 50, 255);
64 shape5->stroke(255, 255, 255, 255);
67 canvas->push(move(shape5));
70 auto shape6 = tvg::Shape::gen();
71 shape6->appendCircle(650, 450, 100, 100);
72 shape6->fill(50, 50, 50, 255);
73 shape6->stroke(255, 255, 255, 255);
76 canvas->push(move(shape6));
82 //Terminate TizenVG Engine
87 win_del(void *data, Evas_Object *o, void *ev)
93 int main(int argc, char **argv)
97 //Show the result using EFL...
100 Eo* win = elm_win_util_standard_add(NULL, "TizenVG Test");
101 evas_object_smart_callback_add(win, "delete,request", win_del, 0);
103 Eo* img = evas_object_image_filled_add(evas_object_evas_get(win));
104 evas_object_image_size_set(img, WIDTH, HEIGHT);
105 evas_object_image_data_set(img, buffer);
106 evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
107 evas_object_show(img);
109 elm_win_resize_object_add(win, img);
110 evas_object_geometry_set(win, 0, 0, WIDTH, HEIGHT);
111 evas_object_show(win);