ico(n) Windows ICO handling ico(n)
NAME
ico - Reading and writing windows icons
SYNOPSIS
package require Tcl 8.4
package require ico ??00.3??
::::ico::::getIconList file ?option value...?
::::ico::::getIcon file index ?option value...?
::::ico::::writeIcon file index depth data ?option value...?
::::ico::::copyIcon file index file2 index2 ?option value...?
::::ico::::EXEtoICO file file2
::::ico::::clearCache ?file?
::::ico::::transparentColor image color
::::ico::::Show file ?option value...?
DESCRIPTION
This package provides functions for reading and writing Windows icons
from ICO, ICL, EXE, and DL files.
API
::::ico::::getIconList file ?option value...?
Returns a list of icons found in file where each element has the
format {width height depth}. Recognizes the following options.
-type value
::::ico::::getIcon file index ?option value...?
Extracts the icon at index from file. The default -format is
image which will return the name of a Tk image containing the
icon. Optionally -name may be used to specify the name of the Tk
image that is created. If -format is colors then a list of color
names in the #RGB format is returned. Each list element is a
horizontal row. Each horizontal row contains a list of colors
for all the pixels in that row from left to right. Recognizes
the following options.
-type value
-format value
-name value
::::ico::::writeIcon file index depth data ?option value...?
file fileName (in)
index integer (in)
This is the 0-based index of the icon to write. When
writing to an EXE, DL, or ICL file you may only over-
write existing icons with an icon of the same dimensions
and color depth. When writing to an ICO, index may be
one greater than the last icon. This will append a new
icon to the file. When writing to an ICO, index will
accept end. This will also cause the new icon to be
appended to the file. When writing the other types end
will refer to the last existing icon.
depth integer (in)
This argument must have a value of 1, 4, 8, 24 or 32. If
data has more colors than the color depth allows an error
will be generated.
data options (in)
This argument is either a list of colors in the format
returned by ::::ico::::getIcon -format colors or the name of
a Tk image.
Recognizes the following options.
-type value
::::ico::::copyIcon file index file2 index2 ?option value...?
Copies the icon at index in file to index2 in file2.
-fromtype value
-totype value
::::ico::::EXEtoICO file file2
Extracts all icons from the executable file to the ICO file
file2
-type value
::::ico::::clearCache ?file?
The ::::ico::::getIconList command caches icon offsets inside EXE,
DL, and ICL files in order to speed up extraction. This com-
mand clears that cache for the specific ?file? or all files.
::::ico::::transparentColor image color
Sets every pixel matching color in Tk image image to transpar-
ent.
::::ico::::Show file ?option value...?
Application level command which displays a window showing all
the icons in file with information about them.
-type value
-parent value
EXAMPLE
button .explore -image [::ico::getIcon explorer.exe 0 -name explore]
set i [lsearch [::ico::getIconList tclkit.exe] {32 32 8}]
set colorlist [::ico::getIcon tclkit.exe $i -format colors -type EXE]
KEYWORDS
dll, entry, exe, ico, icon
ico 0.3 ico(n)
|