WCK and PIL

darnzen darnzen at gmail.com
Sun Feb 7 13:24:40 EST 2010


On Feb 6, 10:19 pm, Nobody <nob... at nowhere.com> wrote:
> On Fri, 05 Feb 2010 21:05:53 -0800, darnzen wrote:
> > I've written an app using thewcklibrary (widget construction kit,
> > seehttp://www.effbot.org), in addition to the wckGraph module. What
> > I'd like to do, is take the output of one of my windows (happens to be
> > a graph), and save it as a *.png or *.gif. I was planning on using the
> >PILfor this. I'd like to use the code I have as is, without re-
> > writing all the graphic calls to usePILmethods.
>
> >WCKuses its own "pixmap" class for storing images in memory. I can't
> > find any documentation or class reference for pixmap and what I find
> > in the source is confusing.
>
> AWCKpixmap is a "draw object" whose underlying drawable is a pixmap
> (i.e. a Tk pixmap, which is the platform's native "chunk of video memory"
> pixmap type) rather than a window.
>
> From the source code,WCKdoesn't appear to offer any way to retrieve the
> pixel data (i.e. there's no way to do the opposite of draw.paste()).

I found a description of how to use a WCK drawing interface to draw
into a PIL image. (http://effbot.org/zone/pil-draw-wck.htm) but I'm
not sure how to use that class (SimpleDraw) to allow me to use
existing WCK code. Should I use it as a "mix in" to overwrite base
methods via inheritance?

class MyClass(SimpleDraw, Widget):
     pass




More information about the Python-list mailing list