admin管理员组文章数量:1125735
I'm just starting at programming, don't even know basics well. Trying to build an app from my own assets, and they all is transparent more or less. I managed to create a window where's background image is transparent, so I can keep textured edges. But I have no idea how to now put the buttons and stuff cause they all drawn the same way. There's my current code and image examples. Hope you can help
from tkinter import *
from tkinter import PhotoImage
from PIL import Image, ImageTk
# Creating root
parent = Tk()
# Main window
parent.image = PhotoImage(file='ui det/main window.png')
label = Label(parent, image=parent.image, bg='white')
# Settings
parent.title('Write it!')
parent.geometry('1300x711')
# Transparency settings
parent.overrideredirect(True)
parent.lift()
parent.wm_attributes('-topmost', True)
parent.wm_attributes("-disabled", True)
parent.wm_attributes("-transparentcolor", "white")
# Start GUI
label.pack()
label.mainloop()
I found many examples of adding transparent image to the background, bub none of this worked when it comes to background that was already with transparency.
本文标签:
版权声明:本文标题:Python - How to add a transparent PNG onto transparent PNG in Tkinter - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736662513a1946487.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论