\section{image\+\_\+example\+\_\+01.\+c}

\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{//gcc -g image\_example\_01.c -o image\_example\_01 `pkg-config --cflags --libs elementary`}

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

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

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

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"image"}, \textcolor{stringliteral}{"Image"});
   elm\_win\_autodel\_set(win, EINA\_TRUE);

   snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"%s/images/plant\_01.jpg"}, elm_app_data_dir_get());

   image = elm_image_add(win);
   \textcolor{keywordflow}{if} (!elm_image_file_set(image, buf, NULL))
     \{
        printf(\textcolor{stringliteral}{"error: could not load image \(\backslash\)"%s\(\backslash\)"\(\backslash\)n"}, buf);
        \textcolor{keywordflow}{return} -1;
     \}

   elm\_image\_no\_scale\_set(image, EINA\_TRUE);
   elm\_image\_resizable\_set(image, EINA\_FALSE, EINA\_TRUE);
   elm\_image\_smooth\_set(image, EINA\_FALSE);
   elm\_image\_orient\_set(image, ELM\_IMAGE\_FLIP\_HORIZONTAL);
   elm\_image\_aspect\_fixed\_set(image, EINA\_TRUE);
   elm\_image\_fill\_outside\_set(image, EINA\_TRUE);
   elm\_image\_editable\_set(image, EINA\_TRUE);

   evas\_object\_size\_hint\_weight\_set(image, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   elm\_win\_resize\_object\_add(win, image);
   evas\_object\_show(image);

   evas\_object\_resize(win, 320, 320);
   evas\_object\_show(win);

   elm_run();

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