ico

package
v0.0.0-...-8b031f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2020 License: ISC Imports: 6 Imported by: 0

README

This package implements PNG-based ICO image encoder.

import "github.com/vldrus/golang/image/ico"

//...

imageFile, err := os.Open("image.jpg")
// if err...
img, fmt, err := image.Decode(imageFile)
// if err...

iconFile, err := os.Create("icon.ico")
// if err...
err = ico.Encode(iconFile, img)
// if err...

Documentation

Index

Constants

View Source
const MaxHeight = 256
View Source
const MaxWidth = 256

Variables

This section is empty.

Functions

func Encode

func Encode(w io.Writer, im image.Image) error

Types

type FileHeader

type FileHeader struct {
	Reserved  uint16
	ImageType uint16
	NumImages uint16
}

type IconDirEntry

type IconDirEntry struct {
	ImageWidth   uint8
	ImageHeight  uint8
	NumColors    uint8
	Reserved     uint8
	ColorPlanes  uint16
	BitsPerPixel uint16
	SizeInBytes  uint32
	Offset       uint32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL