[Image-SIG] Re: [Python-Help] Pixmap widget with access to pixels?
Martin von Loewis
Wed, 29 Mar 2000 13:34:35 +0200
> I've got PIL working with Tkinter in terms of copying an entire pixmap
> over, but this is INCREDIBLY inefficient.
This is what I had suggested. In case you have a specific pixmap
format in mind, you could see whether direct manipulation of the
format is more feasible. E.g. if you use Tk photo images, then you
could see whether direct manipulation of the photo works for you.
I haven't translated this to Python, but in wish, the following
sequence works for me
% image create photo i -file stopp.gif # where stopp.gif is the image
% i get 10 10
255 170 170
% label .l -image i
% pack .l # now, the photo image is displayed
% i put green -to 10 10 20 20 # I get a green rectangle
% i put black -to 15 15 16 16 # a single pixel changes color
In Tkinter, you'd start with a PhotoImage instance, and use its put
and get methods.
Hope this helps,