9 ICO File Reading and Writing
The file/ico library provides functions for reading
and writing ".ico" files, which contain one or more icons.
Each icon is up to 256 by 256 pixels, has a particular depth (i.e.,
bits per pixel used to represent a color), and mask (i.e., whether a
pixel is shown, except that the mask may be ignored for 32-bit icons
that have an alpha value per pixel).
Returns #t if v represents an icon, #f
otherwise.
Returns the width or of an icon in pixels, or the depth in bits per
pixel.
Parses src as an ".ico" to extract a list of icons.
Parses src as an ".exe" to extract the list of
icons that represent the Windows executable.
Writes each icon in
icos to
dest as an
".ico" file. If
dest is not an output port,
exists is passed on to
open-output-file to open
dest for writing.
Writes icons in icos to replace icons in dest as an
Windows executable. Only existing icon sizes and depths in the
executable are replaced, and best matches for the existing sizes and
depth are drawn from icos (adjusting the scale and depth f a
best match as necessary).
Converts an icon to an ARGB byte string, which has the icon’s pixels
in left-to-right, top-to-bottom order, with four bytes (alpha, red,
green, and blue channels) for each pixel.
Converts an ARGB byte string (in the same format as from
ico->argb) to an icon of the given width, height, and depth.
The bstr argument must have a length (* 4 width height),
and (* width depth) must be a multiple of 8.