Posted to tcl by Stu at Wed Aug 27 04:47:19 GMT 2008view raw

  1. proc readFile {fn} {return [read [set f [open $fn]]][close $f]}
  2. image create photo plop -width 400 -height 400
  3. pack [label .l -image plop]
  4. set fn [lindex $argv 0]
  5. set w 300
  6. set x 0
  7. set y 0
  8. set b 10
  9. foreach {c1 c2 c3} [split [readFile $fn] ""] {
  10. if {$c1 eq {}} {set c1 \a}
  11. if {$c2 eq {}} {set c2 \a}
  12. if {$c3 eq {}} {set c3 \a}
  13. plop put #[format %02x%02x%02x [scan $c1 %c] [scan $c2 %c] [scan $c3 %c]] -to $x $y [expr {$$
  14. if {[incr x $b] < $w} { continue }
  15. set x 0
  16. incr y $b
  17. }
  18.  

Comments

Posted by patthoyts at Wed Aug 27 13:41:22 GMT 2008 [text] [code]

testing