I know that you can embed an image in a Tkinter text widget, but I could not find a simple sample code. In particular, I need to embed jpg, so according to the docs, it seems to me that I need to use the photoimage class
I tried using this:
img=PhotoImage ( file=imgfn ) text.image_create(image=img)
where imgfn is the name of the image file and the text is my text widget, but I get "_tkinter.TclError: the data in the image file could not be recognized ..."
Thanks for any help!
source share