\section{bg\+\_\+example\+\_\+02.\+c}

\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{//gcc -o bg\_example\_02 bg\_example\_02.c -g `pkg-config --cflags --libs elementary`}
\textcolor{comment}{//where directory is the a path where images/plant\_01.jpg can be found.}

\textcolor{preprocessor}{#include <Elementary.h>}

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win, *bg;
   \textcolor{keywordtype}{char} buf[PATH\_MAX];

   elm_policy_set(ELM\_POLICY\_QUIT, ELM\_POLICY\_QUIT\_LAST\_WINDOW\_CLOSED);
   elm_app_info_set(elm\_main, \textcolor{stringliteral}{"elementary"}, \textcolor{stringliteral}{"images/plant\_01.jpg"});

   win = elm_win_add(NULL, \textcolor{stringliteral}{"bg-image"}, ELM\_WIN\_BASIC);
   elm_win_title_set(win, \textcolor{stringliteral}{"Bg Image"});
   elm_win_autodel_set(win, EINA\_TRUE);

   bg = elm_bg_add(win);
   elm_bg_load_size_set(bg, 20, 20);
   elm_bg_option_set(bg, ELM\_BG\_OPTION\_CENTER);
   snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"%s/images/plant\_01.jpg"}, elm_app_data_dir_get());
   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();

   \textcolor{keywordflow}{return} 0;
\}
ELM_MAIN()
\end{DoxyCodeInclude}
 