python設置圖片背景和設置字體顏色大小


# -*- coding: utf-8 -*-
"""
Created on Wed Dec 11 22:37:30 2019
@author: Dell
"""
import tkinter

win = tkinter.Tk()

#顯示圖片
photo = tkinter.PhotoImage(file=r"C:\Users\Dell\Pictures\董香2.png")
label = tkinter.Label(win, text="少兒不宜", image=photo)
label.pack()

#設置字體顏色大小等
lbl = tkinter.Label(win, text="Hello 中國", font=("華文彩雲", 100), fg="red", bg="black")
lbl.pack()

win.mainloop()


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM