How to show figure note under an image

Sometimes we need to add a figure note under an image or figure. Following code snippet can be used in this aspect.
/* Take a box to show both image and text */
Evas_Object *box;
box = elm_box_add(ad->conform);
evas_object_move(box, 20, 120);
evas_object_show(box);
char buf[PATH_MAX];
Evas_Object * img = elm_image_add(box);

/* ICON_DIR holds the resource (image) directory path */
/* #define ICON_DIR "/opt/usr/apps/PACKAGE_ID/shared/res" on the project header file. */
snprintf(buf, sizeof(buf), "%s/Tizen.png", ICON_DIR);
elm_image_file_set(img, buf, NULL);
evas_object_size_hint_min_set(img, 200, 200);
evas_object_show(img);
elm_box_pack_end(box, img);

/* below code will show figure note under the figure showed above */
ad->label = elm_label_add(box);
elm_object_text_set(ad->label, "<align=center>Tizen</align>");
evas_object_show(ad->label);
elm_box_pack_end(box, ad->label);

Responses

0 Replies