Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> Python

Tạo cửa sổ trong suốt (Transparent window) Python Tkinter

Tkinter tạo GUI desktop. Tạo cửa sổ trong suốt dùng thuộc tính attributes('-alpha', opacity) với opacity 0.0 - 1.0.

Ví dụ

from tkinter import *

win = Tk()
win.geometry("700x400")
win.attributes('-alpha', 0.3)  # Độ trong suốt 30%

win.mainloop()

Kết quả

Cửa sổ trong suốt 30%.

Tạo cửa sổ trong suốt (Transparent window) Python Tkinter