[Tkinter-discuss] [Tutor] displaying an image

Michael Lange klappnase at web.de
Sat Oct 6 11:57:18 CEST 2012


On Fri, 5 Oct 2012 21:34:02 +0100
Matthew Ngaha <chigga101 at gmail.com> wrote:

> >. So unfortunately you will either have
> > to use an external tool to convert your jpegs into gif first or
> > install a third-party extension like PIL or TkImg* (the latter is
> > easier to use if you only need support for more file formats, because
> > no commands are changed or added, but just support for a lot of image
> > file formats is added silently in the background; I am not sure
> > however if there is a precompiled binary for windows systems is
> > easily available) if you really need these formats.
> 
> > Did this help any?
> > * http://sourceforge.net/projects/tkimg/
> 
> thanks. Yes this was very helpful. im not sure when you say precompiled
> binary for windows systems. i did download the Tkimg software from the
> link you provided. is the next step as easy as extracting the zip file
> into my Python folder or is it more involved?

Yes, im afraid ;)
The first thing you should be aware is that TkImg does not have anything
to do with Python, it is purely an extension to Tcl/Tk.
So if you have the "binary" package the files must go into the Tcl folder
of your Python install, usually something like C:\Python31\tcl .

A binary tcl-extension Package usually contains one or more *.dll files
and a pkgIndex.tcl file; the latter is important for the Tcl Interpreter,
so it knows how to handle the dll(s).

Now I looked at the tkimg14.zip file myself, and actually there don't
seem to be any dlls, just the "source code" that must be
"compiled" ("translated" into machine code) first, which unfortunately
might not be too trivial for a beginner.

If you want to try TkImg anyway without having to compile it yourself,
you can look for example here:

http://www.posoft.de/html/extTkImg.html

They offer packages for "windows7" and for "windows" there, not sure if
these also work with xp or vista in case you still have one of these. I
think it might still be worth a try. Since Tk8.5 is there for years now,
I don't think the Tk version actualy in use should matter.

If you copy the contents of one of the .zip files offered there into your
PythonXY\tcl folder there might be a good chance that it "just works", I
never tested it myself. though.

Best regards

Michael



.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Our way is peace.
		-- Septimus, the Son Worshiper, "Bread and Circuses",
		   stardate 4040.7.


More information about the Tkinter-discuss mailing list