How to set image button transparant

my image button have png image source ,but i got a black background
this my code

    cont = lv_cont_create(bg_middle, NULL);
    lv_obj_set_auto_realign(cont, true);                    /*Auto realign when the size changes*/
    lv_obj_align_origo(cont, NULL, LV_ALIGN_CENTER, 0, 0);  /*This parametrs will be sued when realigned*/
    lv_cont_set_fit(cont, LV_FIT_TIGHT);
    lv_cont_set_layout(cont, LV_LAYOUT_COLUMN_MID);
     lv_obj_set_size(cont, 180, 180);

     lv_obj_t * imgbtn1 = lv_imgbtn_create(cont, NULL);
     lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_PRESSED, &blank_icon);
     lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_RELEASED, &qr_code_icon);
     lv_imgbtn_set_checkable(imgbtn1, true);
     lv_obj_align(imgbtn1, NULL, LV_ALIGN_CENTER, 0, 0);

What settings did you use in the image converter? You’ll need to use “True color with alpha” for it to work:


1 Like

thank it work, can you help me how to make rounded on my code, in the container ?

thanks it works :star_struck: