473,698 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PhotoImage problem

hi
I am using Python 2.5.1. In my code i want to use
self.myimage=Ph otoImage (file=self.myfi le)

so i can create the image in a canvas
self.mycanv.cre ate_image(70,10 0,image=self.my img)

it works when i add,
from ImageTk import PhotoImage

but this import caused an error message when i tried to run this in a
friend's linux machine that had python and PIL. Is PhotoImage part of
standard python library?In new versions of python do i have to modify
this import statement in anyway?

thanks
jim
Jun 30 '08 #1
1 1816
---------- Forwarded message ----------
From: Guilherme Polo <gg****@gmail.c om>
Date: Mon, Jun 30, 2008 at 1:00 PM
Subject: Re: PhotoImage problem
To: jimgardener <ji*********@gm ail.com>
On Mon, Jun 30, 2008 at 12:02 PM, jimgardener <ji*********@gm ail.comwrote:
hi
I am using Python 2.5.1. In my code i want to use
self.myimage=Ph otoImage (file=self.myfi le)

so i can create the image in a canvas
self.mycanv.cre ate_image(70,10 0,image=self.my img)

it works when i add,
from ImageTk import PhotoImage

but this import caused an error message when i tried to run this in a
friend's linux machine that had python and PIL. Is PhotoImage part of
standard python library?In new versions of python do i have to modify
this import statement in anyway?
PhotoImage is a class in the Tkinter module, so if you have from
Tkinter import * and from ImageTk import PhotoImage it is very
possible that you will have problems.
>
thanks
jim
--
http://mail.python.org/mailman/listinfo/python-list

--
-- Guilherme H. Polo Goncalves
Jun 30 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4880
by: Mark 'Kamikaze' Hughes | last post by:
In the new Python game I'm developing, I need to crop out individual tiles from larger tilesets, and maintain transparency. Unfortunately, I've run into major deficiencies in both Tkinter and PIL (PyGame, wxPython, PyQt, etc. are not really suitable for this program, for a number of reasons, and I have zero interest in discussing why right now). Since the Tkinter.PhotoImage.copy() method doesn't allow a region parameter, I have to save...
1
2610
by: Gregor Lingl | last post by:
Hi all, The Tkinter PhotoImage Widget can be set to "transparent" with the method blank(). Moreover the color of single pixels or definite regions can be set with method put. I'd like to set single pixels (or some rectangular regions) to "transparent". Can I use put to
1
1297
by: Harlin Seritt | last post by:
Why is that I can only get the PhotoImage class to show up when I write a straight procedural script (no object orientation) but not when I try to use object-orientation? These two scripts in theory should produce the same results but they don't. Is there any reason why? ---Procedural--- root = Tk()
0
1289
by: Adonis | last post by:
I have two classes one class inherits dict(), this class just takes in a path argument much like glob.glob() and loads the image using PhotoImage into itself, no biggie works fine. The other class inherits Frame and it implements an add(self, **kw) method passes all of its arguments to a Button. My question is that when I load the images with the first class and then use dict.get(name) as the image argument for the add method the image...
117
7205
by: Peter Olcott | last post by:
www.halting-problem.com
2
6745
by: vm | last post by:
please help! I can't find anything wrong (except the result ofc ;-) This: picfile = 'logo.gif'
0
1304
by: shadowsithe | last post by:
I can't seem to find a way to convert an Image.Tk PhotoImage to a PIL Image so that I can use the save function.
2
5514
by: =?iso-8859-1?q?C=E9dric_Lucantis?= | last post by:
Hi, I can only load gif images with Tkinter.PhotoImage and none with BitmapImage. I tried png, jpg, bmp and xpm and always got this errors : Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 3206, in __init__ Image.__init__(self, 'photo', name, cnf, master, **kw) File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 3162, in __init__
1
3130
by: harryos | last post by:
hi i am trying to display an image on a canvas in a gui made with Tkinter widgets class PhotoDisplay: def __init__(self,parent): self.mainframe = Frame(parent,background="grey") ..... #added a subframe to hold canvas and button
0
8675
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7729
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.