LittlevGL version: v7.0.0
I want to scale the image, and the test found something wrong.
What MCU/Processor/Board and compiler are you using?
BLE MCU(ARM)
What do you experience?
After many tests, I found that there is a problem with the scaling of the picture type LV_IMG_CF_TRUE_COLOR, and the LV_IMG_CF_TRUE_COLOR_ALPHA can display normally.
What do you expect?
I expect the picture to scale properly(image_type: LV_IMG_CF_TRUE_COLOR).
Code to reproduce
Add a code snippet to reproduce the issue in the simulator. It should contain only the relevant code which can be compiled. Bug reports without code snippets or with erroneous code snippets will not be reviewed.
The test found that when the picture is zoomed out, it seems that the graphics have some changes (from Right, Bottom edge position). Is there any way to optimize this?
Regarding the LV_IMG_CF_TRUE_COLOR image to achieve transparent display,
I made some modifications as follows:
@ src / lv_draw / lv_draw_blend.c -> map_normal (…)
'[ original code ]' >>
memcpy(&disp_buf_tmp[draw_area->x1], map_buf_tmp, draw_area_w * sizeof(lv_color_t));
'[ modified code ]' >>
for (int index = 0; index < draw_area_w; index ++) {
lv_color_t color = map_buf_tmp[index];
int brightness = lv_color_brightness(color);
if (brightness < 10) {
continue;
} else if (brightness < 60) {
color = lv_color_mix(color, disp_buf_tmp[draw_area->x1 + index], brightness);
}
disp_buf_tmp[draw_area->x1 + index] = color;
}