我的项目是加载一个图像,当我单击一个按钮时,一个文本区域出现在图像中,我可以在上面写一个文本,然后保存写在图像和图像上的文本。为此,我使用了tkinter,但我将图像设置为背景,并添加了一个文本框(text widget)并输入文本,但显然我无法保存该图像(设置为背景)和写在其上的文本。我试着使用PIL,但没有找到我要找的东西。这是我使用tkinter编写的代码:
from tkinter impo
image correctly displayed on canvas:widget = canvasy = 0photo = ImageTk.PhotoImage(img) #Convert To photoimage# thisdoes nothing, just a black canvas
def place_image(widget