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);
24 //Prepare a Shape (Rectangle + Rectangle + Circle + Circle)
25 auto shape1 = tvg::Shape::gen();
26 shape1->appendRect(0, 0, 200, 200, 0); //x, y, w, h, cornerRadius
27 shape1->appendRect(100, 100, 300, 300, 100); //x, y, w, h, cornerRadius
28 shape1->appendCircle(400, 400, 100, 100); //cx, cy, radiusW, radiusH
29 shape1->appendCircle(400, 500, 170, 100); //cx, cy, radiusW, radiusH
30 shape1->fill(255, 255, 0, 255); //r, g, b, a
33 shape1->stroke(255, 255, 255, 255); //color: r, g, b, a
34 shape1->stroke(5); //width: 5px
35 // shape1->strokeJoin(tvg::StrokeJoin::Miter);
36 // shape1->strokeLineCap(tvg::StrokeLineCap::Butt);
38 // uint32_t dash[] = {3, 1, 5, 1}; //dash pattern
39 // shape1->strokeDash(dash, 4);
41 canvas->push(move(shape1));
46 //Terminate TizenVG Engine
51 win_del(void *data, Evas_Object *o, void *ev)
57 int main(int argc, char **argv)
61 //Show the result using EFL...
64 Eo* win = elm_win_util_standard_add(NULL, "TizenVG Test");
65 evas_object_smart_callback_add(win, "delete,request", win_del, 0);
67 Eo* img = evas_object_image_filled_add(evas_object_evas_get(win));
68 evas_object_image_size_set(img, WIDTH, HEIGHT);
69 evas_object_image_data_set(img, buffer);
70 evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
71 evas_object_show(img);
73 elm_win_resize_object_add(win, img);
74 evas_object_geometry_set(win, 0, 0, WIDTH, HEIGHT);
75 evas_object_show(win);