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.
函数
(ico-width ico) → exact-positive-integer?
ico : ico?
函数
(ico-height ico) → exact-positive-integer?
ico : ico?
函数
ico : ico?
修改于package base的6.3版本:A PNG-format icon can have a width or height greater than 256.
函数
(ico-format ico) → (or/c 'bmp 'png)
ico : ico?
添加于package base的6.3版本。
函数
src : (or/c path-string? input-port?)
函数
(read-icos-from-exe src) → (listof ico?)
src : (or/c path-string? input-port?)
函数
(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
函数
(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.
函数
(replace-all-icos icos dest) → void?
icos : (listof ico?) dest : (or/c path-string? output-port?)
函数
(ico->png-bytes ico) → bytes?
ico : ico?
添加于package base的6.3版本。
函数
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.
函数
(png-bytes->ico bstr) → ico?
bstr : bytes?
添加于package base的6.3版本。