2020-11-25 10:09 PM
Hello, I am using customized widget in my project. I get buffer index using below:
*framebuffer = touchgfx::HAL::getInstance()->lockFrameBuffer();
In this customized widget, I want to set few pixels alpha value as 0 so it can be transparent and back ground can be visible.
Any suggestions?
Thanks
2020-11-26 05:14 AM
You could turn this into a generic widget that you can place on top of things and configure to do something with the pixels below: 1x1 or 10x10, set alpha value, blend with other color, etc.
/Martin
2020-11-26 05:29 AM
@Martin KJELDSEN Sorry I didn't get it. How should I set alpha value ? I am setting value of pixel as below image for custom widget.
Thanks
2020-11-26 05:54 AM
I think you should read some general material on how to modify pixels, like blending and applying alpha values. You're doing it in the right place, TouchGFX wise.
/Martin
2020-11-26 06:02 AM
@Martin KJELDSEN Can you please share links ?
2020-11-26 06:06 AM
There's lots of information online, just do some searching. It's pretty standard - Basically you seperate the red, green and blue values from the pixel and apply your alpha, then combine the values.,