Ken McIvor wrote: > On Jul 20, 2007, at 6:26 AM, Michael Droettboom wrote: >> Ken McIvor wrote: >>>> >>> I think PIL's ImageTk module would do the trick for converting RGBA -> >>> PIL Image -> Tk Bitmap/PhotoImage. >> >> That's what I was thinking, too. I don't think there's a way to do this >> in a raw Tkinter. But is PIL something we plan to depend on? > > I don't know, although I'm warming to the idea myself. If we don't > want the Tk backend to depend on PIL, we could create a string > containing an X11 bitmap of the renderer's RGB array and use it to > construct or update a Tkinter.BitmapImage. Tkinter.BitmapImage s are one-bit -- it would have to be a Tkinter.PhotoImage. The options for file formats are GIF and PGM/PPM. PPM is the only of those that supports TrueColor. It would have to be able to be generated efficiently enough from pure Python (seems possible, but I haven't tried yet).
My bigger concern, though, is that there seems to be no way to update just a subregion of the PhotoImage from pure Python. I see that the C code in _tkagg.cpp can do this. Does that actually get used or is it always a full image? Cheers, Mike ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel