Re: pixels

From: Andrew Dorrell <>
Date: Wed, 6 Mar 96 9:31:09 EST

> I have just recently obtained STk, and one of the first things I
> tried to do with it involved placing pixels on the screen. Essentially
> treating a window like a simple raster display. My first attempt at this was
> using 1x1 rectangle objects in a canvas. It worked, but the rectangle is
> complete overkill for what I need, and takes up a lot of memory.
> I see several ways to do this better. Which do you think is more
> feasable? I might be able to create a pixel widget, or maybe format the
> data as a gif or ppm, and display it as an image. If you have any thoughts,
> or have solved this problem previously, please let me know.
        There are a number of ways to tackle this prob depending on your

        1/ There is, on the Tcl/Tk archive site, a raster widget which
        (as I recall) provides structured graphics on a raster

        2/ Add a new data type to STk for a raw array and write a string
        photo Image reader for the type---it could then be displayed as
        a tk photo something like:

        (pack (make <label> :image (image 'create 'photo :data <your-array>)))

I have implemented the latter for the case of N-dimensional arrays of
floating point numbers to support my image processing applications. This
may however be inappropriate for your needs.

Mr Andrew Dorrell
School of Electrical Engineering                 *
University of Technology, Sydney                     *
PO Box 123                                     *
Broadway NSW 2007                                   .  
                                                    *       /---\  Whoo?
Phone:   61 2 330 2395                                      (o o) /
Fax:     61 2 330 2435                                      ( : )  
email:                               ^ ^     
Received on Wed Mar 06 1996 - 00:33:21 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST