Tizen Native API  5.5
Evas_Object_Vg

Evas_Object_Vg is the scene graph for managing vector graphics objects. User can create shape objects as well as fill objects and give it to the Evas_Object_Vg for drawing on the screen as well as managing the lifecycle of the objects. enabling reuse of shape objects.

As Evas_Object_Vg is a Evas_Object all the operation that applicable to a Evas_Object can be performed on it(clipping , map, etc).

To create any complex vector graphics you can create a hirarchy of shape and fill objects and give the hirarchy to Evas_Object which will be responsible for drawing and showing on the screen.

As the shape object and fill object (linear and radial gradient) have retain mode API, you only have to create it once and set the properties and give it to evas_object_vg.

Any change in the property of shape/fill object will automaticaly notified to the evas_object_vg which will trigger a redrawing to reflect the change.

To create a vector path, you can give list of path commands to the shape object using efl_gfx_shape_path_set() API.

Enabling graphical shapes to be constructed and reused.

Below are the list of feature currently supported by Vector object.

  • Drawing SVG Path. You can construct a path by using api in efl_gfx_utils.h
  • Gradient filling and stroking. You can fill or stroke the path using linear or radial gradient.
    See also:
    Evas_Vg_Gradient_Linear and Evas_Vg_Gradient_Radial
  • Transformation support for path and gradient fill. You can apply affin transformation on path object.
    See also:
    Eina_Matrix.
    Note:
    Below are the list of interface, classes can be used to draw vector graphics using vector object.
  • Efl.Gfx.Shape
  • Evas.VG_Shape
  • Evas.VG_Node
  • Efl.Gfx.Gradient
  • Efl.Gfx.Gradient_Radial
  • Efl.Gfx.Gradient_Linear

Example:

 vector = evas_object_vg_add(canvas);
 root = evas_obj_vg_root_node_get(vector);
 shape = efl_add(EVAS_VG_SHAPE_CLASS, root);
 Efl_Gfx_Path_Command *path_cmd = NULL;
 double *points = NULL;
 efl_gfx_path_append_circle(&path_cmd, &points);
 *       evas_vg_node_origin_set(shape, 10, 10);
 *       efl_gfx_shape_stroke_width_set(shape, 1.0);
 *       evas_vg_node_color_set(shape, 128, 128, 128, 80);
 *       efl_gfx_shape_path_set(shape, path_cmd, points); 
Since:
1.14