OS: Windows 10
Python 3.8
I am trying to display PNG images with transparency with no titlebar, or any other indication of window info (imagine sticking a sticker on your screen). I've already done this once in another language by putting an image in a window and removing all the elements of the window, including titlebar and background, but I cannot achieve it in python.
I have already tried Tkinter, but seems like it's not designed to work with PNG transparency and it cannot have separate transparency for parent and child windows.
Now I am trying wxPython. My idea is that it might be possible to make the parent window transparent and the child window (which holds the image) opaque, but cannot figure out if that's even possible.
Here is the simplified version of my attempt:
app = wx.App()
path = 'Images/02.png'
bitmap = wx.Bitmap(path, wx.BITMAP_TYPE_PNG) # Create bitmap
frame = wx.Frame(None,-1,'Transparent Window',size=(1000,1000)) # Create frame (top level window)
frame.SetTransparent(100) # Change transparency of the frame
panel = wx.Panel(frame, -1) # Create panel (to hold the image)
wx.StaticBitmap(panel, -1, bitmap) # Put the image in the panel
panel.SetTransparent(255) # Change transparency of the panel (the image)
frame.Show()
app.MainLoop()
But unfortunately ".SetTransparent()" only works on top level window, so I can't set the transparency of the panel to anything else.
But basically, the question is, is it possible to display image with transparency on its own with Python? I am not looking for any specific method of achieving this, the one I provided was just the only one I know. So please help me if you can :)
Edit 1: Tried to use wx.lib.agw.advancedsplash:
import wx
import wx.lib.agw.advancedsplash as AS
app = wx.App()
frame = wx.Frame(None, -1, "AdvancedSplash Test")
imagePath = "Images/05.png"
bitmap = wx.Bitmap(imagePath)
splash = AS.AdvancedSplash(frame, bitmap=bitmap)
app.MainLoop()
But it still fills in transparent areas