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()

猜你喜欢

转载自www.cnblogs.com/zxfei/p/12026364.html