Python Forum
[Tkinter] Why is it so difficult to just ouput an image where I want?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Why is it so difficult to just ouput an image where I want?
#1
from Tkinter import *

root = Tk()
# Remove titlebar    
root.overrideredirect(1)
canvas = Canvas(root, width =100,height=153)
logo=PhotoImage(file="a.png")
canvas.create_image(100, 100, image=logo) 
root.mainloop()
All I get is a blank window of the wrong size in the wrong position.

My requirements:
Simplicity - just output a simple png file (I'll pass it as a parameter if I can get this to work.
No external programs.
No clicking on it
Ability to position it
Ability to destroy it
It will actually be a function called over and over to output selected png files at a specific location.
python2 or 3 - don't care. I ran this in python2

I know the file exists because when it doesn't, I get:
_tkinter.TclError: couldn't open "a.png": no such file or directory

I thought it would be easy to do this in python because the big program I got for my application is in python and I just want to make a few modes (like outputting images).
Reply


Messages In This Thread
Why is it so difficult to just ouput an image where I want? - by jpezz - Apr-03-2019, 09:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Switching from tkinter to gtk is difficult! snakes 1 1,499 Aug-08-2022, 10:35 PM
Last Post: woooee

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020