How to create a transparent window using dispmanx on a raspberry Pi?

I am working on a slide show application and am using SDL 1.2 using the special dispmanx firewall ( https://github.com/vanfanel/SDL12-kms-dispmanx ) with Pygame to create overlays on top of omxplayer.

Everything works fine and the layers are correct, but I cannot make a transparent canvas in dispmanx without making my objects transparent. I understand that Pygame alone cannot handle this, and before SDL handle transparency between dispmanx layers.

My goal is to hardware accelerate a transparent canvas the size of my screen above omxplayer, which I can draw on.

I suspect that you need to use a method other than using the alpha settings in vc_dispmanx_element_add? XBMC uses dispmanx and can do opaque overlays over omxplayer, so this should be possible. I also looked at vc_dispmanx_display_set_background, but it looks like it's only RGB, not alpha.

+4
source share
1 answer

Instead of creating a transparent window, you can take a screenshot and use it as a background. For this, I used pyscreenshot to get the image (although there are other options) and

os.environ['SDL_VIDEO_WINDOW_POS']="0,0" 

so that the window is always in the right place, the only weakness in this is that the window is no longer transparent, if something changes behind it

0
source

Source: https://habr.com/ru/post/1490819/


All Articles