Questions tagged [photoimage]
104 questions
0
votes
1 answer
Tkinter's photoimage class
The first answer in this link is what I am regarding in the following: python tkinter: how to work with pixels?
Regarding tkinter's Photoimage class, how would I clear it and update it so that I can see the frames live and make animations?…

Corpus Shmorpus
- 21
- 8
0
votes
1 answer
tkinter canvas only updates with an error
I'm writing a code that will display a .png in a canvas widget whenever the user selects an item in a Treeview widget. When I run my code, the image only displays in the canvas when there is an error thrown in the selectedItems function. So far,…

Drew Wilkins
- 55
- 9
0
votes
0 answers
Can't zoom using phtoImage in tkinter
I'm trying to zoom in & out, in a canvas. But when I zoom, the canvas still empty. Here is my code
teste.py
from tkinter import *
from observable import *
class Model(Observable):
def __init__(self):
Observable.__init__(self)
…

icetom 54
- 63
- 7
0
votes
1 answer
How do I make an image appear on this button in python with the following code?
So I need to get an image of mine on a button that I've created in python. But it pops up with the error (widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: image "pyimage2" doesn't exist. Also, I've made the main window of my…

Ambrose Odongkara
- 79
- 9
0
votes
1 answer
Tkinter PhotoImage won't Work
I have been creating a file that displays a image on a canvas. I created the 'PhotoImage' file that I use to store my picture.
d = PhotoImage(file="pic.gif")
canvas = Canvas(root, 500, 500)
pic = canvas.create_image(20, 20, image=d)
But I just…

Lumater
- 23
- 5
0
votes
1 answer
I can't change the image using label.configure
I am trying to create a GUI in which I can process images, so I have to change the default image to the one chosen by the browse button.
The default image disappears but the new image doesn't appear. Help Please!
Here is my code:
from Tkinter…

Dorra Hadrich
- 79
- 1
- 2
- 12
0
votes
1 answer
Resize pgm image using Tkinter only
I have an image that I display and I would like to resize (enlarge, actually) that image. Here's my code, using other SO questions, but I get no result - my image still has the same size. Resizing the button also does not change the image size.
I've…

Jonas
- 1,473
- 2
- 13
- 28
0
votes
1 answer
Why won't my .gif files show up when I call them using PhotoImage?
from tkinter import *
from random import *
from functools import partial
class Game:
def __init__(self):
self.root = Tk()
self.frame = Frame(width = 574, height = 574)
self.frame.grid(columnspan = 30, rowspan = 30)
…

Christopher Berry
- 685
- 2
- 7
- 18
0
votes
3 answers
Python 3 tkinter Photoimage "pyimage1" doesn't exist
PhotoImage: Tkinter PhotoImage objects and their idiosyncracies
http://tkinter.unpythonic.net/wiki/PhotoImage
I tested the example with python 2.7.9, 3.2.5, 3.3.5, 3.4.3 in 32bit and 64bit.
(Win 8.1 64bit)
The code works. ( even without pillow )
(…

frank.p
- 11
- 1
- 3
0
votes
1 answer
Using PhotoImage to display an image in Tkinter in Python
I'm trying to create an application that has a main menu and a settings menu. I want to set background for each of these. But I'm starting with the settings menu. I'be been getting an error stating:
_tkinter.TclError: image "pyimage1" doesn't…

Zack Harley
- 140
- 1
- 9
0
votes
0 answers
tkinter doesn't display image from outside the main file in a label
Ok, the code works fine when I execute it directly. If I put it in a class or function, the widget has the correct size and gets displayed, but stays gray. Why is that? Any name space issue that I don't get?
#doesn't work
def example(tk,…

Haunt_House
- 127
- 6
0
votes
2 answers
Python: Whole image not showing
Today I was trying to learn how the PhotoImage works but I run into errors and problems non stop. After lots of research I finally get an image to show up BUT its not the whole image, just a piece of it.
Heres my code:
from tkinter import*
root =…

Gabriel Almodovar
- 27
- 2
- 6
0
votes
1 answer
How to update image at different location in Tkinter
I'm trying to use the paste(im, box=(4-tuple)) method to update a shown image in a Label created in Tkinter(python) window.
Following code is a minimal example showing what I'm doing. The background is the existing image and the mask is the image to…

shi
- 286
- 1
- 9
0
votes
1 answer
Python Tkinter Buttons just work with hardcoded Images
I am searching for a way to generate buttons with pictures for a little game.
I am using Tkinter and a Grid layout in two ways but only one of them worked.
Here is the example code of the first (hardcoded) way to generate the Button with a…

Reallyor
- 37
- 9
0
votes
1 answer
How to insert an image into a tkinter sub frame
I am trying to develop a program which has a main frame (root) from which other frames are opened and closed via a menu. The main frame has an image inserted ok but as soon as I open another frame and try to insert a new image using:
canvas =…

user3770670
- 1
- 1
- 3