ico

package module
v1.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: BSD-2-Clause Imports: 6 Imported by: 1

README

ico

This is a simple module library for building windows ICO files that may some day be complete.

The module features an abstraction type for icon files so they can be decoded as well as encoded.

Features that I intend to include are:

  • Encoding of PNG images (like most golang ico modules)
  • Encoding of BMP images
  • Encoding of paletted images
  • Encoding of paletted images with alpha
  • Decoding of ICO files

Example usage

img := image.NewRGBA(image.Rect(0,0,32,32))

eudenil := color.RGBA{164, 184, 135}

draw.Draw(img, img.Bounds(), &image.Uniform{eudenil}, image.ZP, draw.Src)

icon := ico.NewIcon()
icon.AddPng(img)

bytes, err := icon.Encode()

Documentation

Overview

Copyright 2022 Staffan Thomen <staffan@thomen.fi> Use of this source code is governed by a BSD-style license found in the adjacent LICENSE file.

Index

Constants

View Source
const BMP = 1
View Source
const CUR = 2
View Source
const ICO = 1

file type, icon or cursor

View Source
const NOALPHA = -1
View Source
const PNG = 0

determine subimage type

Variables

This section is empty.

Functions

func New

func New(t int) *icon

Create a new icon

func NewCursor

func NewCursor() *icon

Create a new cursor object

func NewIcon

func NewIcon() *icon

Create a new icon object

Types

This section is empty.

Jump to

Keyboard shortcuts

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