cancel
Showing results for 
Search instead for 
Did you mean: 

Modify alpha value of specific pixels of customized widget

Hello, I am using customized widget in my project. I get buffer index using below:

*framebuffer = touchgfx::HAL::getInstance()->lockFrameBuffer();

0693W000005ChaGQAS.png 

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

5 REPLIES 5
Martin KJELDSEN
Chief III

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

@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.

0693W000005Cm0XQAS.png 

0693W000005Cm0mQAC.png 

Thanks

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

@Martin KJELDSEN​  Can you please share links ?

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.,