Tk Newbie need Tk strategy help for updating image in canvas 
Author Message
 Tk Newbie need Tk strategy help for updating image in canvas
Greetings. First of all, can someone on point me to the
FAQ for

Now my question, and apologies if this is in the FAQ.  I have developed some
microscopy image analysis software in perl, and now I am working on the user
interface.  I wonder if someone can point me in the right direction for
dynamically updating the displayed image like so:

I have created a canvas widget to display the image (using Tk::TIFF).  But I
want to allow the user to set a threshold, and to visualize the threshold by
turning all pixels below the threshold some color (say, blue).  So I plan to
use the Scale widget to get the threshold level.  But once I get the
threshold, how do you recommend I update the image (a la Gimp after you make
some image adjustment)?  Here are some ideas I had:

1. I could create a new temproary tiff with the pixels below threshold
recolored, and then reload the new tiff from file into the canvas.  But this
seems like it would be terribly slow.

2. I could convert the tiff to a bitmap, modify the bitmap, and update the
canvas object.  I have written a perl module which gives me the Tiff image
data as an array of pixel intensities (libtiff does this as well), and it
appears from the documentation that I could convert it to X11 bitmap format
and use the -data => $string option? If that's right, can someone point me
to documentation on the X11 bitmap format?

Thanks for your help,

Sat, 23 Aug 2003 22:45:59 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Tk Newbie need Tk strategy help for updating image in canvas

2. Any way to export a Perl/Tk Canvas to an image file

3. Perl/TK scrolled canvas scale IMAGE function???

4. Draw on image, similar to Tk::Canvas?

5. Displaying GIF images in Tk::Canvas

6. TK, canvases and images

7. How to update the images in TK

8. Tk Canvas createText() Tk VERSION 800.023

9. Help needed on Tk::Dirtree or Tk::Dirlist

10. TK::filevent, and Tk::update

11. changing bitmap for images used in Tk::Tk::messageBox


Powered by phpBB® Forum Software