> It appears that the Tk canvas widget does not support simply plotting a  
>pixel.  
>

Correct, and I agree it seems odd, but in practice drawing either lines or 
ovals of one-pixel do the equivalent job - albeit a little more slowly.

> The  primitive obviously exists in the underlying code, 

It probably exists in the native graphics toolkit (Xlib or Win32 or Aqua) 
but it doesn't exist at the Tk level which is why Tkinter can't expose it.

FWIW wxPython does provide a DrawPoint() method as part of its 
DeviceContext class.

Digging a little deeper it seems the idiomatic way to do this in Python 
is to use PIL the Python Imaging Library to create a GIF or bitmap 
image and then insert that into Tkinters cancvas as an image object.

The Pil ImageDraw class has a point() ethod

I've never tried this but it is described in Grayson's (now out of print?) 
book on Tkinter where he uses it to draw a Mandelbrot....
The book may be available online these days...

Nowdownloadall.com seems to have it although I've no idea 
of the legality of it!

HTH,

Alan G.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to