Open ajaiantilal opened 8 years ago
In UG_DrawBMP(), invalid color conversion done when BMP format is 565.
just before this line the color is set to 888 format, but that causes wrong colors to be displayed on a 565 format screen https://github.com/achimdoebler/UGUI/blob/master/ugui.c#L5840
a possible fix:
tmp = *p++; #ifdef USE_COLOR_RGB565 UG_DrawPixel( xp++ , yp , tmp ); #else /* Convert RGB565 to RGB888 */ r = (tmp>>11)&0x1F; r<<=3; g = (tmp>>5)&0x3F; g<<=2; b = (tmp)&0x1F; b<<=3; c = ((UG_COLOR)r<<16) | ((UG_COLOR)g<<8) | (UG_COLOR)b; UG_DrawPixel( xp++ , yp , c ); #endif
@achimdoebler:
BTW: No, the project is still alive! [06.08.2017]
Good news, thanks! So please commit this fix or explain in short why it doesn't fit.
I had tested this fix, and the results are success
In UG_DrawBMP(), invalid color conversion done when BMP format is 565.
just before this line the color is set to 888 format, but that causes wrong colors to be displayed on a 565 format screen https://github.com/achimdoebler/UGUI/blob/master/ugui.c#L5840
a possible fix: