2 //gcc -g `pkg-config --cflags --libs elementary` image_example_01.c -o image_example_01
4 #include <Elementary.h>
6 # include "elementary_config.h"
9 # define PACKAGE_DATA_DIR "."
13 elm_main(int argc __UNUSED__, char **argv __UNUSED__)
15 Evas_Object *win, *bg, *image;
18 win = elm_win_add(NULL, "image", ELM_WIN_BASIC);
19 elm_win_title_set(win, "Image");
20 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
21 elm_win_autodel_set(win, EINA_TRUE);
24 elm_bg_color_set(bg, 255,255 ,255);
25 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
26 elm_win_resize_object_add(win, bg);
29 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
31 image = elm_image_add(win);
32 if (!elm_image_file_set(image, buf, NULL))
34 printf("error: could not load image \"%s\"\n", buf);
38 elm_image_no_scale_set(image, EINA_TRUE);
40 elm_image_scale_set(image, EINA_FALSE, EINA_TRUE);
42 elm_image_resizable_set(image, EINA_FALSE, EINA_TRUE);
43 >>>>>>> remotes/origin/upstream
44 elm_image_smooth_set(image, EINA_FALSE);
45 elm_image_orient_set(image, ELM_IMAGE_FLIP_HORIZONTAL);
46 elm_image_aspect_fixed_set(image, EINA_TRUE);
47 elm_image_fill_outside_set(image, EINA_TRUE);
48 elm_image_editable_set(image, EINA_TRUE);
50 evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
51 elm_win_resize_object_add(win, image);
52 evas_object_show(image);
54 evas_object_size_hint_min_set(bg, 160, 160);
55 evas_object_size_hint_max_set(bg, 640, 640);
56 evas_object_resize(win, 320, 320);
57 evas_object_show(win);