Loads a .cur file.
Loads a ico file off the given file or from the given memory block.
Load implementation. Api subject to change.
Save implementation. Api subject to change.
The icon directory entry of a .ico or .cur file. Note the alignment is not correct for slurping the file.
A representation of a cursor image as found in a .cur file.
The header of a .ico or .cur file. Note the alignment is not correct for slurping the file.
void main() { auto thing = loadIco("test.ico"); import std.stdio; writeln(thing.length); // tell how many things it found /+ // just to display one import arsd.simpledisplay; auto img = new SimpleWindow(thing[0].width, thing[0].height); { auto paint = img.draw(); paint.drawImage(Point(0, 0), Image.fromMemoryImage(thing[0])); } img.eventLoop(0); +/ // and this converts all its versions import arsd.png; import std.format; foreach(idx, t; thing) writePng(format("test-converted-%d-%dx%d.png", idx, t.width, t.height), t); }
Written July 21, 2022 (dub v10.9)
Save support added April 21, 2023 (dub v11.0)
Load and save support for Windows .ico icon files. It also supports .cur files, but I've not actually tested them yet.