Questions tagged [photoimage]

104 questions
1
vote
1 answer

Why does this keep popping up in two seperate windows? (Python)

I've created a very basic word game that I want to create a basic gui for. I am testing a file that will put an image on a canvas and then place text boxes for the words over-top of the image. I cannot seem to get it to use the same window. The…
1
vote
1 answer

Make image full screen with PhotoImage

I've tried this but it doesn't help: Image resize under PhotoImage I already have this: import tkinter root = tkinter.Tk() root.attributes("-fullscreen", True) photo = tkinter.PhotoImage(file="image.gif") img1 = tkinter.Label(root, image =…
Henry
  • 3,472
  • 2
  • 12
  • 36
1
vote
1 answer

py2exe gives RuntimeError: Too early to create image

This python27 32bit code runs perfectly in IDLE, but when packaged by py2exe... not so good. This is not a duplicate of the missing Tk() question. Something else appears to be uninitialized when running the py2exe generated executable, the call at…
charo
  • 715
  • 1
  • 7
  • 14
1
vote
2 answers

AttributeError when creating tkinter.PhotoImage object with PIL.ImageTk

I am trying to place an image resized with PIL in a tkinter.PhotoImage object. import tkinter as tk # I use Python3 from PIL import Image, ImageTk master = tk.Tk() img…
user7043649
  • 48
  • 1
  • 1
  • 7
1
vote
1 answer

Find identical images in Tkinter?

My Tkinter GUI loads the album cover of a certain song/artist combination directly from the associated last.fm link (looks like this: http://ift.tt/1Jepy2Cbecause it's fetched by ifttt.com and redirects to the png file on last.fm.) When there is no…
gowner
  • 327
  • 1
  • 4
  • 11
1
vote
2 answers

Tkinter PhotoImage in a class won't show

I have a button that shows a new frame with a picture label in it. The label and image are exactly as they are in all the tutorials but the picture doesn't show. It is a .gif. What am I doing wrong? Here is my code: from Tkinter import * class…
Jonah Fleming
  • 1,187
  • 4
  • 19
  • 31
1
vote
1 answer

Load image from BytesIO object to Tk widget

I want to render an image from a BytesIO object to a canvas for this I'm using this code: from io import BytesIO from Tkinter import * from PIL import Image as ImageModule f = open("test.png","rb") bdata =…
Tarik Mokafih
  • 1,247
  • 7
  • 19
  • 38
1
vote
1 answer

Image won't display on tkinter canvas

I'm really hoping for some help on this as it has me absolutely stumped. I have the code working on its own as per below: from tkinter import * from PIL import ImageTk dam_level = [75] c = Canvas(width = 200, height = 235, relief = "sunken",…
SGB
  • 225
  • 2
  • 14
1
vote
5 answers

cannot associate image to tkinter label

I am trying to display an image to a tkinter GUI using tkinter.Label() widget. The procedure seems simple and straightforward, but this code doesn't work! code: import Tkinter as tk import Image, ImageTk, sys filename = 'AP_icon.gif' im =…
1
vote
2 answers

python button does not work when image is added

When I try to add and image to the button, the program will run, but the button will be blank and you cannot click on it. If I change image=Tkinter.PhotoImage(file="C:/TeDOC/OpenFolder.gif") to text='Open Directory it works fine and you are able to…
0
votes
0 answers

Python Multiple Choice questions, with images as button answers

Buttons with images are not showing in my tkinter GUI. I have this working with text and works great but I want to use images as opposed to text for the questions. All of this if based on code I modified from the following…
0
votes
0 answers

Creating thumbnail buttons using loop in tkinter

` `D={} lang=[] Lrow=[0,1,2,3,4] Lcolumn=[0,1,2,3] for num1 in Lrow: for num2 in Lcolumn: pair=str(num1)+str(num2) lang.append(pair) data=gettingdata.orderbyavailableartasc() …
0
votes
0 answers

How can I display an image in a Tkinter frame?

In the next code I am tryng to display an image in my frame: from tkinter import PhotoImage import tkinter as tk from PIL import Image, ImageTk root = tk.Tk() root.title("My window") root.geometry('500x400') frame =…
bedipat
  • 21
  • 3
0
votes
1 answer

PhotoImage Tkinter problem: Button not working and not displaying

im using Proxlight Designer to create Drag-n-drop GUI. It is a application that works with open-cv-python, but a Button is not displaying. It seems as if open-cv is the problem, because if you remove it the Button displays and works properly. Here…
0
votes
0 answers

Tkinter load images faster?

Currently I'm using def load(load_list, path_to_animation_folder): for frame in os.listdir(path_to_animation_folder): full_path = os.path.join(path_to_animation_folder, frame) loaded_image =…
Aleksas
  • 66
  • 8