Tkinter图像作为backgorund [英] Tkinter image as backgorund

查看:99
本文介绍了Tkinter图像作为backgorund的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Tkinter中将图像设置为背景?我有正确的图像,一切都没有出现



我尝试过:



how can i set an image as a background in Tkinter? I have the correct image and everything but nothing comes up

What I have tried:

root = tk.Tk()
root.title("Tool")
root.configure()

frame = tk.Frame(root)
frame.pack()
background_image = tk.PhotoImage('pic.jpg')
background_label = tk.Label(frame, image=background_image)

推荐答案

您需要告诉Tkinter在哪里显示图像: python - 如何在tkinter中使用图像作为背景? - 堆栈溢出 [ ^ ]
You need to tell Tkinter where to display the image: python - How to use an image for the background in tkinter? - Stack Overflow[^]


这篇关于Tkinter图像作为backgorund的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆