2011-06-16 07:10:23 -07:00
|
|
|
//Compile with:
|
2012-03-29 23:34:07 -07:00
|
|
|
//gcc -o bg_example_02 bg_example_02.c -g `pkg-config --cflags --libs elementary`
|
2012-03-19 05:58:07 -07:00
|
|
|
//where directory is the a path where images/plant_01.jpg can be found.
|
2011-06-16 07:10:23 -07:00
|
|
|
|
|
|
|
#include <Elementary.h>
|
|
|
|
|
2012-03-27 23:04:36 -07:00
|
|
|
EAPI_MAIN int
|
2017-04-19 23:33:59 -07:00
|
|
|
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
2011-06-16 07:10:23 -07:00
|
|
|
{
|
|
|
|
Evas_Object *win, *bg;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
2013-06-25 18:54:58 -07:00
|
|
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
2012-03-29 23:34:07 -07:00
|
|
|
elm_app_info_set(elm_main, "elementary", "images/plant_01.jpg");
|
2013-06-25 18:54:58 -07:00
|
|
|
|
2011-06-16 07:10:23 -07:00
|
|
|
win = elm_win_add(NULL, "bg-image", ELM_WIN_BASIC);
|
|
|
|
elm_win_title_set(win, "Bg Image");
|
2011-08-12 08:26:58 -07:00
|
|
|
elm_win_autodel_set(win, EINA_TRUE);
|
2011-06-16 07:10:23 -07:00
|
|
|
|
|
|
|
bg = elm_bg_add(win);
|
2011-06-20 09:15:59 -07:00
|
|
|
elm_bg_load_size_set(bg, 20, 20);
|
2011-06-16 07:10:23 -07:00
|
|
|
elm_bg_option_set(bg, ELM_BG_OPTION_CENTER);
|
2012-03-29 23:34:07 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
|
2011-06-16 07:10:23 -07:00
|
|
|
elm_bg_file_set(bg, buf, NULL);
|
|
|
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
elm_win_resize_object_add(win, bg);
|
|
|
|
evas_object_show(bg);
|
|
|
|
|
|
|
|
evas_object_resize(win, 320, 320);
|
|
|
|
evas_object_show(win);
|
|
|
|
|
|
|
|
elm_run();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
ELM_MAIN()
|