fix(canvas): correct RGB565 pixel offset in lv_canvas_get_px (#9188)

Co-authored-by: ychsiao168 <ychsiao168@pm.me>
This commit is contained in:
ychsiao168
2025-11-04 01:51:41 +08:00
committed by GitHub
parent 9c05fce72b
commit 47c1471cc3
+3 -3
View File
@@ -229,9 +229,9 @@ lv_color32_t lv_canvas_get_px(lv_obj_t * obj, int32_t x, int32_t y)
break;
case LV_COLOR_FORMAT_RGB565: {
lv_color16_t * c16 = (lv_color16_t *) px;
ret.red = (c16[x].red * 2106) >> 8; /*To make it rounded*/
ret.green = (c16[x].green * 1037) >> 8;
ret.blue = (c16[x].blue * 2106) >> 8;
ret.red = (c16[0].red * 2106) >> 8; /*To make it rounded*/
ret.green = (c16[0].green * 1037) >> 8;
ret.blue = (c16[0].blue * 2106) >> 8;
ret.alpha = 0xFF;
break;
}