Add support for saving icons at higher resolutions #7

Closed
opened 2024-11-03 20:33:07 +00:00 by Ruben · 3 comments
Owner

Right now icons are only saved as 32x32 bitmaps for any selected folder / icon. Larger icons can be fetched with the Windows API function already being used up to 256x256 so it should not be hard to add.

Right now icons are only saved as 32x32 bitmaps for any selected folder / icon. Larger icons can be fetched with the Windows API function already being used up to 256x256 so it should not be hard to add.
Ruben added this to the v0.1.0a milestone 2024-11-08 20:09:18 +00:00
Author
Owner

As mentioned on stackoverflow (https://stackoverflow.com/questions/28012229/what-is-the-maximum-size-of-an-icon-returned-from-shgetfileinfo), SHGetFileInfoW cannot directly retrieve "jumbo icons" (256x256). The system image index of said icon needs to be retrieved, the image from the system image list converted to an icon, then the bitmap can be built from the icon handle.

See the following links:

As mentioned on stackoverflow (https://stackoverflow.com/questions/28012229/what-is-the-maximum-size-of-an-icon-returned-from-shgetfileinfo), _SHGetFileInfoW_ cannot directly retrieve "jumbo icons" (256x256). The system image index of said icon needs to be retrieved, the image from the system image list converted to an icon, then the bitmap can be built from the icon handle. See the following links: - https://learn.microsoft.com/en-us/windows/win32/controls/image-lists - https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shgetimagelist - https://learn.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-imagelist_geticon
Author
Owner

SHGetImageList can help get the jumbo image list as explained here (https://stackoverflow.com/questions/30495641/using-shgetimagelist-how-to-use-himagelist), then the index from SHGetFileInfoW can be used to build the jumbo icon from the specified index in the jumbo image list.

_SHGetImageList_ can help get the jumbo image list as explained here (https://stackoverflow.com/questions/30495641/using-shgetimagelist-how-to-use-himagelist), then the index from _SHGetFileInfoW_ can be used to build the jumbo icon from the specified index in the jumbo image list.
Author
Owner

Fixed by commit 1a3d97044f

All icons now saved in 256x256 or max resolution.

Fixed by commit 1a3d97044f All icons now saved in 256x256 or max resolution.
Ruben closed this issue 2025-01-06 10:11:47 +00:00
Commenting is not possible because the repository is archived.
No description provided.