user1402362
user1402362

Reputation:

Show image in Tkinter for python 3.2

How to display an image in Python 3.2 using Tkinter? The PIL doesn't work so something that doesn't use it.

Upvotes: 0

Views: 8023

Answers (3)

wsa
wsa

Reputation: 1

try this (for python 3)

from tkinter import PhotoImage




photo = PhotoImage(file="/home/pi/pile.gif")
lb=tkinter.Label(root,image = photo)
lb.grid(row=4, column=1)

Upvotes: 0

Jeremy Toledano
Jeremy Toledano

Reputation: 1

it's very simple:

photo = PhotoImage(file="C:\pictures\pic1.gif")
label = Label(image=photo)
label.pack()

Upvotes: 0

Bryan Oakley
Bryan Oakley

Reputation: 385980

Use the Tkinter PhotoImage class to create an image object, then assign this object to the image attribute of a Label widget.

For more information see http://effbot.org/tkinterbook/photoimage.htm

Upvotes: 4

Related Questions