[pyar] Cargar diferentes formatos de imagen en tkinter.ttk

craf prog en vtr.net
Jue Nov 25 20:50:02 ART 2010


Hola.

Estoy trabajando con tkinter.ttk y probando los estilos y temas que
vienen con la versión 8.5

Con este pequeño código....

------------------------------------------------------------
from tkinter import *
from tkinter import ttk
import image

master = Tk()
s = ttk.Style()
s.theme_use('clam')

foto = PhotoImage(file='mi_imagen.gif')
b = ttk.Button(master,compound='left',image=foto,text="Hola
Mundo").pack()

master.mainloop()
-----------------------------------------------------------

....estoy probando que imágenes se pueden cargar.
Según el manual de tkinter.ttk, solo se pueden cargar imágenes "gif",
pero leí que también se pueden trabajar otro tipo de formato de imágenes
con la librería PIL. El problema es que esta librería parece que trabaja
solo hasta python 2.6 y en windows (Utilizo Ubuntu).

Pregunta:

¿Existe alguna otra librería que trabaje con python 3.1 y permita
trabajar con formatos de imagen como PNG o JPG?.

Desde ya muchas gracias.

Saludos.

CRAF




More information about the pyar mailing list