‎2019-02-18 09:16 PM
Hi,how can i change color depth for QRCode widgets.My application template is STM32L4r9-Discovery which has a 24-bit screen ,but the QRCode widgets is 12-bit color depth.so i guess could i change QRCode widgets's color depth to 24-bit that i can use this widgets on my application template.
Thanks!
Best wishes
‎2019-02-18 11:45 PM
Hi,
The QR widget works on a 16-bit framebuffer pointer. You can modify this to work on an 8-bit pointer (Using reinterpret_cast) and write to the framebuffer in increments of three.
uint8_t* buf = reinterpret_cast<uint8_t*>(HAL::getInstance()->lockFrameBuffer());
Best regards,
Martin
‎2019-02-19 01:19 AM
:D
‎2019-02-21 11:22 PM
Hi ,@Martin KJELDSEN​
Thanks !!I have downloaded hex into my application template,but it can't run.The following this picture is screen is not running.The code is as follows.
uint8_t *framebuffer = reinterpret_cast<uint8_t*>(touchgfx::HAL::getInstance()->lockFrameBuffer());
for (int y = invalidatedArea.y; y < invalidatedArea.bottom(); y++)
{
for (int x = invalidatedArea.x; x < invalidatedArea.right(); x++)
{
for (int i = 0; i < 3; i++)
{
framebuffer[x * 3 + i + y * 3 * 390] = code->at(x / scale, y / scale) ? 0x00 : 0xff;
}
}
}
touchgfx::HAL::getInstance()->unlockFrameBuffer();
Could you help me to see what's wrong ,and how can i solve it.(Ps:I add a box widgets which is blue in middle screen )
Thank you very much!!!
Jack li
‎2019-02-22 05:00 AM
Does it work when your framebuffer is 16bpp?
‎2019-02-22 10:12 PM
When i use stm32f429-disco which framebuffer is 16 bpp,it works properly .