Languages

Menu
Sites
Language
how to make images circular

Images is coming from API in shape of rectangular how to make it circular.

Edited by: kumar sonu on 25 Sep, 2017

Responses

1 Replies
Yasin Ali

Hi,

You may try to do this in the following way. Please have a look.

Evas_Object *table = elm_table_add(ad->win);
evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_content_set(ad->conform,table);
evas_object_show(table);


ad->button = elm_button_add(ad->conform);
evas_object_size_hint_weight_set(ad->button,0.0,1.0);
evas_object_size_hint_align_set(ad->button,-1.0,1.0);
elm_object_style_set(ad->button, "circle");
elm_object_text_set(ad->button,"Click Me!");
evas_object_show(ad->button);
elm_table_pack(table, ad->button, 3, 1, 1, 1);

Evas_Object *ic;
ic = elm_icon_add(ad->button);
elm_image_file_set(ic,ICON_DIR"/img.png",NULL);
elm_object_part_content_set(ad->button,"icon",ic);
evas_object_show(ic);
#define ICON_DIR "/opt/usr/apps/org.example.button_image/res/images"

Also check some helpful resources

https://developer.tizen.org/ko/development/guides/native-application/user-interface/efl/ui-components/customizing-ui-components?langredirect=1

https://developer.tizen.org/community/code-snippet/native-code-snippet/circle-button-specified-text-label-and-image

Hope it will help you.
If you find my post is helpful for you, please mark it as answer to promote this post to others.