Design Introduction “Air” Styles Mobile Design Principles Styles UX Overview Design Patterns UI Components for Tizen App Design 2.3 TV Design Principles Styles UX Overview Patterns UI Components Wearable Development Tizen Studo Overview Download Tizen Extensions for Visual Studio Family IoT extension SDK Docs Blog Blog Announcing the Tizen Studio 3.7 Release Announcing the Tizen Studio 3.1 Release Community Forums General Support Tizen .NET Web Application Development Native Application Development SDK & IDE Design Introduction “Air” Styles Mobile Design Principles Styles UX Overview Design Patterns UI Components for Tizen App Design 2.3 TV Design Principles Styles UX Overview Patterns UI Components Wearable Development Tizen Studo Overview Download Tizen Extensions for Visual Studio Family IoT extension SDK Docs Blog Blog Announcing the Tizen Studio 3.7 Release Announcing the Tizen Studio 3.1 Release Community Forums General Support Tizen .NET Web Application Development Native Application Development SDK & IDE
Adding Background Image to Box
Hi All,
I am trying to add background image to a Box container.
But with all option set using below code I am not able to see any background image after installing App.
Evas_Object *image_box = elm_box_add(mbox);
elm_box_horizontal_set(image_box, EINA_FALSE);
elm_box_padding_set(image_box, 16, 10);
evas_object_size_hint_weight_set(image_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(image_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
Evas_Object *img_bg = elm_bg_add(image_box);
char bg_path[200] = {0};
sprintf(bg_path, “%s%s”, app_get_resource_path(), “img/headerbg_portrait.png”);
elm_bg_file_set(img_bg, bg_path, NULL);
elm_bg_color_set(img_bg, 0,40, 40);
elm_bg_option_set(img_bg, ELM_BG_OPTION_SCALE);
evas_object_size_hint_weight_set(img_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(img_bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(img_bg);
elm_object_part_content_set(image_box, “elm.swallow.background”, img_bg);
elm_box_pack_end(mbox, image_box);
evas_object_show(image_box);
Is there anything wrong in my code? or Am I missing to use any APIs?
Thank you.
BY
16 Apr 2025
Tizen Studio
BY
04 Nov 2024
Tizen Studio
BY
02 Apr 2024
Tizen Studio