2021-06-07 09:08 PM
Hi,
I want to ask if the sequence of color changed when touchgfx generate the .png image source code.
The r255g000b000_480_640.png image is red in RGB888(0xff0000),when touchgfx generate the image_r255g000b000_480_640 source code in RGB888 is 0x0000ff.
If i miss something in image settings?
Thanks for your attention.
r255g000b000_480_640.png iamge in touchgfx.
image_r255g000b000_480_640 source code in mdk.
Solved! Go to Solution.
2021-06-08 12:18 AM
Hello alivexiaoluo,
It's because the framebuffer format of the LTDC in 24bit mode is BGR when seen as bytes. It's similar for 32bpp where RGBA is stores as BGRA when seen as bytes because of little endian.
If you don't use LTDC, you can use DMA2D to swap the order from BGR to RGB.
But overall, for many display interfaces you can configure the order of bytes you send.
When your question is answered, please close this topic by choosing Select as Best.
/Alexandre
2021-06-08 12:18 AM
Hello alivexiaoluo,
It's because the framebuffer format of the LTDC in 24bit mode is BGR when seen as bytes. It's similar for 32bpp where RGBA is stores as BGRA when seen as bytes because of little endian.
If you don't use LTDC, you can use DMA2D to swap the order from BGR to RGB.
But overall, for many display interfaces you can configure the order of bytes you send.
When your question is answered, please close this topic by choosing Select as Best.
/Alexandre
2021-06-08 01:04 AM
Hi,Alexandre RENOUX.
I set the lcd driver chip (Sitronix ST7701S register 36H)to rgb mode, the display works fine.
Thanks for your help.