Go up one levelGo to Previous Go to Next

Image Window

A number of [incr Tcl] widgets have been developed around the rtdimage type. The RtdImage widget creates a canvas window and puts the image in it, so that it can be treated just like any other Tk widget and inserted in an application with the Tk pack command. In addition, the RtdImage widget implements methods and creates other widgets for dealing with line graphics, rapid frames, image color management, cut levels, pixel information and statistics. Besides the main image window, the zoom window, the pan window, rapid frame and colormap display window are all based on (i.e.: use an instance of) the RtdImage widget.

 

Below is an example that shows how to create a simple RtdImage widget and perform some simple operations, such as loading a fits file, setting the cut levels, scaling or displaying the graphics popup window.

 
 
# create and pack RtdImage 
pack [RtdImage .image -scrollbars 1] -fill both -expand 1 
 
# load a test image, set the cut levels, scale 3x 
.image config -file test.fits 
.image cut 0 1000 
.image scale 3 3

See RtdImage(n) for more details.

To make building applications easier, a compound widget RtdImageCtrl can be used. It includes a main image, zoom window, pan window, colormap display and image info display. This covers most of what an application will need for the main window, other than the menu bar and mini-help area.

If you replace RtdImage in the example above with RtdImageCtrl , you would get a window like the one below:

See RtdImageCtrl(n) for more details.


Go up one levelGo to Previous Go to Next

Please send questions or comments to abrighto@eso.org.
Copyright © 1998 ESO - European Southern Observatory