\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();
   elm_shutdown();

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