页:1
ICO 文件格式 解析器和构建器.
安装
npm install @fiahfy/ico
使用量
分析
import fs from 'fs'
import { Ico } from '@fiahfy/ico'
const buf = fs.readFileSync('icon.ico')
const ico = Ico.from(buf)
console.log(ico.fileHeader) // IcoFileHeader { reserved: 0, type: 1, count: 7 }
console.log(ico.infoHeaders[0]) // IcoInfoHeader { width: 16, height: 16, ... }
大楼
import fs from 'fs'
import { Ico, IcoImage } from '@fiahfy/ico'
const ico = new Ico()
let buf
buf = fs.readFileSync('128x128.png')
image = IcoImage.fromPNG(buf)
ico.append(image)
buf = fs.readFileSync('256x256.png')
image = IcoImage.fromPNG(buf)
ico.append(image)
/* Some other PNG files */
fs.writeFileSync('icon.ico', ico.data)
API 密码
类:Ico
静态从(缓冲)
从图标缓冲器创建哈里发国.
缓冲
类型 : Buffer
哈里发国图标缓冲器.
附件( 图像)
在结尾添加哈里发国图像.
图像
类型 : IcoImage
哈里发国图像作为附件.
插入(图像、索引)
在指定位置插入哈里发组织图像.
图像
类型 : IcoImage
要插入的哈里发国图像 .
指数
类型 : number
插入ICO图像的位置 .
删除( 索引)
删除指定位置的哈里发组织图像.
指数
类型 : number
哈里发图像要删除的位置 .
文件头
类型 : IcoFileHeader
交回哈里发国的文件头.
信息头
类型 : IcoInfoHeader[]
归还哈里发国的信息头条.
图像
类型 : IcoImage[]
把哈里发国的图像还给我.
数据
类型 : Buffer
归还哈里发国缓冲器.
类: IcoImage
静态从(缓冲)
从缓冲器创建哈里发图像 .
缓冲
类型 : Buffer
哈里发国图像缓冲器.
来自PNG(缓冲)的静态
创建哈里发国 PNG图像缓冲器的图像.
缓冲
类型 : Buffer
PNG图像缓冲器.
类: IcoInfoheader( IcoInfoheader) :
静态从(缓冲)
从缓冲器创建哈里发国信息头.
缓冲
类型 : Buffer
哈里发国信息头缓冲器.
类: IcoFile 页眉
静态从(缓冲)
从缓冲器创建 ICO 文件头 .
缓冲
类型 : Buffer
ICO文件头缓冲.
规格
支持的大小
| 大小 |
|---|
| 16x16 (英语) |
| 24x24 (英语) |
| 32x32 (英语) |
| 48x48 (英语) |
| 64x64 (英语) |
| 128x128 (英语) |
| 256x256 (韩语) |