ico

a tklib package to read and write icons from ICO ICL EXE and DLL files. see windows icons for more info. documentation is at ico

[perhaps someone could add a screenshot?]


MG just found this package again, and found it very useful. I was trying to add winico support to my app, and wanted to add an icon to the taskbar, but change the icon used periodically. Winico seems to only let you do this if all the icons you want to use are contained in one file (and mine weren't), but it was a simple case of

  package require ico
  set newico "new.ico"
  set old [list foo.ico bar.ico baz.ico]
  set i 0
  foreach x $old {
    ico::copyIcon $x 0 $newico $i
    incr i
  }

and I had a single file, new.ico, which contained all the icons from my other files.

AF says glad you found it useful, I just want to make this even easier:

  package require ico
  set newico "new.ico"
  set old [list foo.ico bar.ico baz.ico]
  foreach x $old {
    ico::copyIcon $x 0 $newico -1
  }

MG Cool, thanks. I didn't know you could use -1 like that.


jbr - There is a bug in the tklib 1.4 such that the padding on the and mask is incorrect. replace a line in ::ico::getAndMaskFromColors to look like:

       append l [string repeat 0 [expr {(32 - ([string length $l] % 32))%32}]]

I have filed a bug on sourceforge.

icoview2