Reading/Displaying Binary data 
Author Message
 Reading/Displaying Binary data

I am trying to write an application which will read a binary
file generated in C and display it as a 2 dimensional image
where color indicates the value ( ie. an image ).  I am new
to programming this kind of thing in Tcl, so I have a few
questions.

1) Reading binary data
   using the open command, how do I read in the binary data from
   the file

2) displaying this data
   How does one display data that is just in a two dimensional
   array?

Thanks.  BTW, please respond to the newsgroup

--

  SFA, Inc                                "Lobt Gott!"          --+--
  Naval Research Lab, Wash DC                                     |
                                                                  |

   "There are no physicists in the hottest parts of hell, because the
    existence of a "hottest part" implies a temperature difference,
    and any marginally competent physicist would immediately use this
    to run a heat engine and make some other part of hell comfortably
    cool. "

   "The woods are lovely, dark and deep.  But I have promises to keep,
    And lines to code before I sleep, And lines to code before I sleep."
                                    - Eric Youngdale & Robert Frost



Sun, 03 Nov 1996 23:05:46 GMT  
 Reading/Displaying Binary data

|> I am trying to write an application which will read a binary
|> file generated in C and display it as a 2 dimensional image
|> where color indicates the value ( ie. an image ).  I am new
|> to programming this kind of thing in Tcl, so I have a few
|> questions.
|>
|> 1) Reading binary data
|>    using the open command, how do I read in the binary data from
|>    the file

You don't. Tcl can only cope with strings and that means that you
cannot have 0. You need to encode that data coming from your C program
or write a Tcl command that reads the data into a C array.

|> 2) displaying this data
|>    How does one display data that is just in a two dimensional
|>    array?

This is something for you to decide, I believe that the canvas widget
allows you to set the colour of a pixel so you could use that and there
was a raster widget announced recently that would probably also work
for you.

--

Michael Salmon

#include        <standard.disclaimer>
#include        <witty.saying>
#include        <fancy.pseudo.graphics>

Ericsson Telecom AB
Stockholm



Mon, 04 Nov 1996 14:55:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Reading a binary file / writing binary data to a file

2. Reading Arguments from Command Line and reading binary data

3. How can i display binary data on the front panel

4. newbie:displaying raw binary data

5. Reading binary double floats from an old data file

6. Reading & displaying text data

7. Fortran/C code to read LV binary data?

8. Reading relocatable binary data from SMF files

9. Reading and writing binary data from files

10. Howto read binary data?

11. Reading lots of binary data into arrays

12. Reading binary data files

 

 
Powered by phpBB® Forum Software