The following approach also fails。
lv_style_t knob_style;
lv_style_init(&knob_style);
lv_style_set_pattern_image(&knob_style, LV_STATE_DEFAULT, &volume_value_background_box);
lv_obj_add_style(s, LV_SLIDER_PART_KNOB, &knob_style);
The problem with your image is the it’s “indexed” but it should be normal RGB. I converted it with GIMP and now it works well.
Here is the new image:
Not that the pattern is cropped to the size of the knob so the knob should be large enough to hold the pattern. You can do this by adding some extra padding to it: