Languages

Menu
Sites
Language
How do i change the image dynamically to hello.png

part {
            name: "logo1";
            type: IMAGE;
            scale: 0;
            desc{
               image.normal: "ic_network_wifi.png";
               min: 16 16;
               max: 50 50;
               rel1.relative: 0.7 0;
               rel2.relative: 1.0 1.0;

            }
         }

The code for setting my layout is:

ad->layout = elm_layout_add(ad->win);

elm_layout_file_set(ad->layout, edj_path, "main");

evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
eext_object_event_callback_add(ad->layout, EEXT_CALLBACK_BACK, layout_back_cb, ad);

 elm_object_content_set(ad->conform, ad->layout);

 

How do i get the image reference and change it to hello.png during runtime.

 

 

View Selected Answer

Responses

2 Replies
Mark as answer
Yasin Ali

You have to add another description and 2 different states to move them
in between dynamically say by clicking etc. See code below for code hint:

part {
             name: "logo1";
             type: IMAGE;
             scale: 0;
             desc{
    state: "default" 0.0;
                image.normal: "ic_network_wifi.png";
                min: 16 16;
                max: 50 50;
                rel1.relative: 0.7 0;
                rel2.relative: 1.0 1.0;

            }
   desc{
    state: "clicked" 0.0;
                image.normal: "hello.png";
                min: 16 16;
                max: 50 50;
                rel1.relative: 0.7 0;
                rel2.relative: 1.0 1.0;

            }
          }
}


      programs {
         program { name: "to_default_0";
            signal: "to,state,default,0";
            source: *;
            action: STATE_SET "default" 0.00;
            target: "logo1";
         }
         program { name: "to_clicked_0";
            signal: "to,state,clicked,0";
            source: *;
            action: STATE_SET "clicked" 0.00;
            target: "logo1";
         }
      }
  
   from cpp
  
   elm_object_signal_emit(layout, "to,state,default,0", "*");
   elm_object_signal_emit(layout, "to,state,clicked,0", "*");

Hope it will help.

Rohit Shinde

Thanks Yasin, it was great help!