WCK and PIL

D

darnzen

I've written an app using the wck library (widget construction kit,
see http://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
PIL for this. I'd like to use the code I have as is, without re-
writing all the graphic calls to use PIL methods.

WCK uses 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.

Does anyone have any direct experience with these libraries that can
tell me that there's some super easy thing I'm missing? I'd love it if
the wck pixmap is compatible with PIL. I don't have the time to mess
with it unless I know its going to work.
 
N

Nobody

I've written an app using the wck library (widget construction kit,
see http://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
PIL for this. I'd like to use the code I have as is, without re-
writing all the graphic calls to use PIL methods.

WCK uses 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.

A WCK pixmap 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, WCK doesn't appear to offer any way to retrieve the
pixel data (i.e. there's no way to do the opposite of draw.paste()).
 
D

darnzen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,260
Messages
2,571,039
Members
48,768
Latest member
first4landlord

Latest Threads

Top