Categorygithub.com/ArtificialLegacy/go-ico
modulepackage
0.0.0-20240905165543-df31b047e3f7
Repository: https://github.com/artificiallegacy/go-ico.git
Documentation: pkg.go.dev

# README

goico

Implements basic support for encoding and decoding ICO files.

Supported

  • .ico and .cur
  • BMP Images
  • 32bit Alpha
  • CUR Hotspots

Unsupported

  • PNG Images

Usage

Config Decoding

f, err := os.Open("favicon.ico")
if err != nil {
    panic(err)
}
defer f.Close()

config, err := goico.DecodeConfig(f)
if err != nil {
    panic(err)
}

Decoding

f, err := os.Open("favicon.ico")
if err != nil {
    panic(err)
}
defer f.Close()

config, imgs, err := goico.Decode(f)
if err != nil {
    panic(err)
}

Encoding

f, err := os.Create("favicon.ico")
if err != nil {
    panic(err)
}
defer f.Close()

imgs := []image.Image{...} // images with a max size of 256x256
ico, err := goico.NewICOConfig(imgs)
if err != nil {
    panic(err)
}

err = goico.Encode(f, ico, imgs)
if err != nil {
    panic(err)
}

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
hotspots is a list of x, y pairs.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
.cur is type 2.
.ico is type 1.
No description provided by the author

# Structs

No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author