Displaying a picture with tkinter

Rick Pasotto rickp at telocity.com
Thu May 17 10:37:55 EDT 2001


On Tue, 15 May 2001 16:48:04 -0400 in comp.lang.python, Arthur Perlo wrote:
> Hi,
> 
> My program generates an image (picture), consisting of an
> NxM array of 8- or 16-bit pixels. I want to display it in
> my python application. I gather that I need the Image or
> PhotoImage widget, but the only documentation I can find is
> for loading the image from a file. My image is generated by
> my program.
> 
> Can anyone point me to documentation or (preferably) sample
> code that will show me how to do this?
> 
> (Unfortunately, I am not only new to python, but am ignorant
> of Tk. I couldn't find understandable (by me) documentation
> of this for Tk, either).

Have you looked at the PIL (Python Imaging Library) package? It
contains a TkImage module that I think will do what you want.

-- 
Hence, if anything is self-evident, it is this: law is the
organization of the natural right to legitimate self-defense, it
is the substitution of collective force for individual forces, to
act in the sphere in which they have the right to act, to do what
they have the right to do: to guarantee security of person,
liberty, and property rights, to cause justice to reign over all.
	-- Frédéric Bastiat (1801-1850)
    Rick Pasotto    rickp at telocity.com    http://www.niof.net



More information about the Python-list mailing list