Elementary photo widget
This code snippet shows how to use elementary photo widget. This widget is designed to show person's photo. When no image is loaded it shows a placeholder.
12345678910111213141516171819202122232425// create box for our photo objectsEvas_Object *box = elm_box_add(ad->win);evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);elm_win_resize_object_add(ad->win, box);evas_object_show(box);// create the first photoEvas_Object* photo = elm_photo_add(ad->win);evas_object_size_hint_weight_set(photo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);evas_object_size_hint_align_set(photo, EVAS_HINT_FILL, EVAS_HINT_FILL);// set photo file (PHOTO_DIR should look like this "/opt/usr/apps/org.tizen.myproject/res/images")char file[PATH_MAX];snprintf(file, sizeof(file), "%s/image.png", PHOTO_DIR);elm_photo_file_set(photo, file);evas_object_show(photo);elm_box_pack_end(box, photo);// create another photo without sending an actual image file - placeholder is shownEvas_Object* empty_photo = elm_photo_add(ad->win);evas_object_size_hint_weight_set(empty_photo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);evas_object_size_hint_align_set(empty_photo, EVAS_HINT_FILL, EVAS_HINT_FILL);evas_object_show(empty_photo);elm_box_pack_end(box, empty_photo);