Modules

Ico_File

moduleSource

Available on macOS, Linux, Windows, Wasm

#import "Ico_File";

Procedures#

Ico encode#

(x: s32, y: s32, comp: s32, image_data: *u8) -> string

Makes Windows ICO files from pictures: create_ico_file from pixels, or create_ico_file_from_bitmap_filename from an image file. Each icon holds five sizes, 256 down to 16.

(comp: s32, size: s32) -> (image_bytes: s32, mask_bytes: s32, total_bytes: s32)

How many bytes one square icon image takes in an ICO file: the pixels with their header, the transparency mask, and the total. comp is bytes per pixel (3 or 4).

Ico load#

(bitmap_filename: string) -> string

Reads an image file (any format the image decoder knows) and returns it as an ICO file, as create_ico_file does. Returns an empty string after logging an error if it cannot be read or decoded.