Forum: Poser Python Scripting


Subject: Picture in Button

Grammer opened this issue on Apr 13, 2002 ยท 5 posts


Grammer posted Sat, 13 April 2002 at 5:01 AM

Hi: I am currently writing a small programm which can evolve facial expressions - my question, is how do I get apicture from a file into a button ? Thanx, Karl


Montressor posted Sun, 21 April 2002 at 12:41 PM

First construct at label like this:

label = Label(root,bitmap=, ...other options ...)

use the place geometry manager to put it inside your button wherever you want it.

If you need more code, let me know...

Montressor


Grammer posted Mon, 22 April 2002 at 10:00 AM

Thanx, in the meantime I had managed this, but in a weird way. I couldnt get an image from poser through PIL and then into TK. Now I save it from Poser as a TIF, load it in PIL, then save it as GIF and finally load it into TK. Apparently nobody could help me to find a better way of bringing a picture from Poser to TK. Is there one ? The programm itself uses a genetic algorithm to evolve facial expressions - the user clicks into one he likes, and then the evolution process takes place. This can be done with faces and even whole figures.

Montressor posted Wed, 01 May 2002 at 5:25 AM

Nice idea. However, Poser (at least, as far as I know) will not save gifs directly. wxPython will handle jpgs, which it will save, but not Tk.


Montressor posted Thu, 02 May 2002 at 12:06 AM

Oh, am I dumb! Why not just export the jpg and then use ImageTk.PhotoImage to get it back in?