Platforms to show: All Mac Windows Linux Cross-Platform
Back to FolderItem class.
FolderItem.IconMBS(width as Integer, WindowsFlags as Integer=0) as picture
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Icon Service | MBS Picture Plugin | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes | All |
Changed in plugin version 7.7 to return a picture with mask of the given size.
On Windows the icon picture is scaled to the requested size. (Actually the plugin can only get 32bit pixels wide icons on Windows as maximum)
Version 8.6: Now reads the 32bit image data with 8 bit alpha values if possible.
You can pass flags for Windows options:
SHGFI_ADDOVERLAYS | = &h20 | Apply the appropriate overlays to the file's icon. |
SHGFI_LINKOVERLAY | = &h8000 | Adds the link overlay to the file's icon. |
SHGFI_OPENICON | = 2 | Retrieve the file's open icon |
SHGFI_SELECTED | = &h10000 | Blend the file's icon with the system highlight color. |
This function can fail if the file does not exist.
Please note that icons on alias files takes much longer to get than normal files.
Added 1024 pixel support in 12.3 plugins.
On Windows, it may be that you get a 256 pixel icon with small icon on top left. This is simply how windows handles the case when no big icon is available.
For Linux, please use LinuxIconMBS module.
Some examples using this method:
- /Linux/Directory Listings with Icons
- /MacCG/Icon with CGContext
- /MacClassic/Unmount disk
- /MacCocoa/Drop file to see icon parts
- /MacCocoa/NSWorkSpace DropFile to see icon parts
- /MacOSX/Input Sources
- /Picture/Hierarchical Listbox with Icons
- /Picture/Icon/Folderitem Icon Example
- /Util/App sizes
- /Util/Process/Process Example
The items on this page are in the following plugins: MBS Picture Plugin.