winresource

package
v0.1.0-alpha.90 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: GPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package winresource turns the brand icon into the Windows resource object that gives magichandy.exe its icon.

The Go linker links every *_windows_amd64.syso file it finds in a package directory. A resource object is a COFF file with one .rsrc section holding the Windows resource tree, so no extra tool or dependency is needed at build time: the committed object is rebuilt from the committed icon by cmd/windows-resource, and a test fails when the two drift apart.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Object

func Object(ico []byte) ([]byte, error)

Object builds the COFF resource object for an amd64 Windows executable whose icon is the given .ico file. The output depends only on the input bytes.

Types

type Image

type Image struct {
	Width, Height uint8 // 0 means 256
	ColorCount    uint8
	Planes        uint16
	BitCount      uint16
	Data          []byte // a DIB without its file header, or a PNG
}

Image is one picture inside an icon file.

func ParseICO

func ParseICO(ico []byte) ([]Image, error)

ParseICO reads the images of a Windows .ico file.

Jump to

Keyboard shortcuts

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