It's part of the libraries included with my v2 version of ActiveScript Shell
(pka Majerus.net ActiveShell which was also on CE
).
Basically since I like pixel-art, ANSI-art, and the terminal, I included a component that can load icons, bitmaps, images, fonts,... and render them as ANSI-art
(text with mosaic characters and colors control sequences to display in the terminal
).
Since I wrote the code to convert .ico and .bmp to ANSI-art, without relying on any API except file access, I decided to include support for WinCE 2bpp bitmaps and icons as well.
I don't think it should be included in your apps library since it's not WinCE and is getting new versions regularly without clear versioning at this point.
But you can grab it directly from my public OneDrive folder at
https://onedrive.phm.lu/
Take "Majerus.net ActiveScript Shell
(x64
).msi" or "Majerus.net ActiveScript Shell
(x86
).msi" depending on your OS architecture, and try the following commands in JScript at the prompt:
var ansi = new ActiveXObject("Majerus.ANSI");
echo(ansi.loadIcon("axsh.exe,0", 16, 16, 4));
This shows how to get the first icon from a .exe
(index is zero-based
), use the 1st 16×16 4bpp image of that icon, and render it in the terminal.
If you specify a .ico or .ic2 you just provide the filename
(with the path, doubling backslashes because it's the escape character
), for .icl, .exe, .dll, it will use the default
(first
) icon if only the filename is specified, but you can use the same syntax as used by the shell in the registry to specify the icon, using the comma and an icon index as a positive number, or an icon resource ID as a negative number
(as in "axsh.exe,-101" would get icon ID#101
).
For WinCE 2bpp icon, you simply specify 16, 16 or 32, 32 for the size you want, and 2 for the bit depth, as in
echo(ansi.loadIcon("C:\\some path\\winceapp.exe,0", 16, 16, 2));
Note it does not perform any conversion, the dimensions and bit depth requested must be in the specified icon resource.
Use the following command for more details:
docs(ainsi, "loadIcon");