12 ICO File Reading and Writing
(require file/ico) | package: base |
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). The library also provides support for reading and writing icons in Windows executables.
procedure
(ico-width ico) → exact-positive-integer?
ico : ico?
procedure
(ico-height ico) → exact-positive-integer?
ico : ico?
procedure
ico : ico?
Changed in version 6.3 of package base: A PNG-format icon can have a width or height greater than 256.
procedure
(ico-format ico) → (or/c 'bmp 'png)
ico : ico?
Added in version 6.3 of package base.
procedure
src : (or/c path-string? input-port?)
procedure
(read-icos-from-exe src) → (listof ico?)
src : (or/c path-string? input-port?)
procedure
(write-icos icos dest [#:exists exists]) → void?
icos : (listof ico?) dest : (or/c path-string? output-port?)
exists :
(or/c 'error 'append 'update 'can-update 'replace 'truncate 'must-truncate 'truncate/replace) = 'error
procedure
(replace-icos icos dest) → void?
icos : (listof ico?) dest : path-string?
Use replace-all-icos, instead, to replace a set of icons wholesale, especially when the set include PNG-format icons.
procedure
(replace-all-icos icos dest) → void?
icos : (listof ico?) dest : (or/c path-string? output-port?)
procedure
(ico->png-bytes ico) → bytes?
ico : ico?
Added in version 6.3 of package base.
procedure
width : (integer-in 1 256) height : (integer-in 1 256) bstr : bytes? depth : (one-of/c 1 2 4 8 24 32) = 32
The bstr argument must have a length (* 4 width height), and (* width depth) must be a multiple of 8.
procedure
(png-bytes->ico bstr) → ico?
bstr : bytes?
Added in version 6.3 of package base.