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