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(50, 50, 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->fill(50, 50, 50, 255); //r, g, b, a
32 shape1->stroke(255, 255, 255, 255); //color: r, g, b, a
33 shape1->stroke(5); //width: 5px
34 // shape1->strokeJoin(tvg::StrokeJoin::Miter);
35 // shape1->strokeLineCap(tvg::StrokeLineCap::Butt);
37 // uint32_t dash[] = {3, 1, 5, 1}; //dash pattern
38 // shape1->strokeDash(dash, 4);
40 canvas->push(move(shape1));
45 //Terminate TizenVG Engine
50 win_del(void *data, Evas_Object *o, void *ev)
56 int main(int argc, char **argv)
60 //Show the result using EFL...
63 Eo* win = elm_win_util_standard_add(NULL, "TizenVG Test");
64 evas_object_smart_callback_add(win, "delete,request", win_del, 0);
66 Eo* img = evas_object_image_filled_add(evas_object_evas_get(win));
67 evas_object_image_size_set(img, WIDTH, HEIGHT);
68 evas_object_image_data_set(img, buffer);
69 evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
70 evas_object_show(img);
72 elm_win_resize_object_add(win, img);
73 evas_object_geometry_set(win, 0, 0, WIDTH, HEIGHT);
74 evas_object_show(win);