AnsweredAssumed Answered

STemWin Alpha Blend Transparent Child to Opaque Parent

Question asked by John Schuler on Aug 30, 2017



I'd like to know if it is possible to configure alpha blending such that the transparent pixels of a child rectangle are blended with the frame buffer contents created by the parent.  It appears the only way to blend is against the solid background.  My goal is to render a gradient background, organizational tiling over that, plus buttons and text over the tiles.  Tiles and buttons all have rounded corners, for which I'm manually setting the alpha value while leaving the color constant. 


My display driver is configured for 32 bit color using the 8888 LIN driver. I am using two hardware layers to render the attached image.  Layer 0 contains a black background, underneath the blue gradient, underneath the large rounded rectangle.  Layer 1 contains a transparent background, underneath the two sibling plus and minus buttons.   The black corners are what I'm trying to eradicate.  I would expect that when the rectangle is drawn, the gradient underneath would be drawn first, followed by the rectangle on top.  As the top rectangle is drawn, any nonzero alpha pixels would cause the rectangle color to blend with the gradient underneath, which would be the current contents of the frame buffer.  Instead, the pixels are shades of the black background color. 


Thanks in advance,