Make the canvas background transparent

What LVGL version are you using?

V 6.1.2

What do you want to achieve?

I want to make the canvas background transparent

I want to put an image on the canvas and rotate it
At this time, the background should be transparent

please Help!

Code to reproduce


	canvas_measure = lv_canvas_create(scr,NULL);

	lv_img_dsc_t img; = (void *)cbuf_measure_temp; = LV_IMG_CF_TRUE_COLOR;
	img.header.w = CANVAS_WIDTH;
	img.header.h = CANVAS_HEIGHT;


I’m not sure if making the canvas transparent is possible in v6. If the buffer is chroma keyed, try filling it with LV_COLOR_TRANSP. If that still doesn’t work, you may have to update to v7.

I’m in v7, and using lv_canvas_fill_bg() (if this is what you’re referring to) with LV_OPA_TRANSP did not work; it did work using the standard lv_obj_get_style_bg_opa() call, FWIW.

It didn’t solve the problem, so I drew it myself using “LINE”.
Thank you very much