473,396 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Imaging using PIL

I feel fairly well versed in getting Tkinter to do what I want, but now
I'm venturing into the whole imaging thing, and placing text and
graphics over some static background image. I'm trying to use PIL, but
what I get from this code is a new window with a gray background, not
the image I'm trying to open. Here's the code:

class Imaging:

def __init__(self, parent):

working = self.working = Toplevel(parent)

type = gui.mediavar.get()
print type
if type == 15:
print 'Should see small label'
self.labelimage = 'labelsmall.gif'
elif type == 25:
print 'Should see large label'
self.labelimage = 'labelbig.gif'
self.img = PhotoImage(file =
'C:/ClearView_Printer/' + self.labelimage)
self.width = self.img.width()
self.height = self.img.height()
self.canvas = Canvas(working, width =
self.width, height = self.height, selectborderwidth = 0)
self.canvas.pack(side = TOP, fill = BOTH, expand
= 0)
self.canvas.create_image(0, 0, anchor = NW,
image = self.img)

I'm currently getting code reference from Python and Tkinter Programming
by John E. Grayson. Most of the stuff in there is heavy in image
mapping, but there seem to be some core elements I can use, I just don't
seem to be using them correctly. Any input would be appreciated.

TIA,

- Mark

Jul 18 '05 #1
1 1717
"mark" <ma**@diversiform.com>
I feel fairly well versed in getting Tkinter to do what I want, but now I' m venturing into the whole imaging thing, and placing text and graphics over some static background image. I'm trying to use PIL, ....
? What has PIL to do wth it?
... but what I get from this code is a new window with a gray background,
not the image I'm trying to open.


The code looks o.k. Maybe width or height are zero (because of some peculiar
GIF problem); in that case the Canvas would be invisible and you would just
see the gray Toplevel...

Kindly
MichaelP
Jul 18 '05 #2

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

Similar topics

1
by: Mark Nelson | last post by:
Hi I'm trying to build Imaging 1.1.4 in Solaris 9, I get passwd the first step i.e the building of libImging. However when I execute a python setup.py build I get the following error - gcc...
2
by: Richard | last post by:
In the days of VB6 I would often use the Wang/Kodak Imaging control that ships with Windows to process TIFF files. Drop the ocx on a form and TIFF file manipulation is all very easy. So how do...
0
by: MC | last post by:
Hi, I'm developing an VB.NET app that converts TIFFs to PDFs using Office Imaging 2003 and Adobe Distiller 6.0 in the follwing way: 1. Using automation, I open the TIFF file with Office...
3
by: David A. Osborn | last post by:
I currently have a class that has an enumeration of graphics extensions that it supports ie: Public Enum GraphicFormats JPG JPEG BMP TIFF End Enum
0
by: cybersurfer | last post by:
Hi All I am using the Kodak Suite of Imaging controls (OCX) to make a basic image viewing and editing application. But, when using the ImageThumbnail control I get an unhandled exception in...
5
by: Prateek | last post by:
Hi. I'm creating a web-application using CherryPy 2.2.1. My application needs to process images (JPG/PNG files) to 1) create thumbnails (resize them) 2) overlay them on a custom background (a...
0
by: kristelbof | last post by:
Our new project requires imaging from the auto scanning feeder. Autoscan will be saved in a single file with file extension of .TIF. But we are planning to separate each image in its own file....
1
by: Naha | last post by:
Hi, I am starting a new project where I have to create a office monitoring system, whereby I need to capture images from a webcam and analyse these images using Java advanced imaging in order to...
0
by: tavares | last post by:
----------------------------------------------------------------------------------------------------------------------------------------- (Apologies for cross-posting) International Journal of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.