I know that this has been discussed before, but the IconFamilyMBS is now gone and I’m looking for the proper replacement logic for this code that pulls the icon for a provided file extension:
i = New IconMBS("", "", theExtension, "")
WMain.lbRestorePaths.RowPicture(WMain.lbRestorePaths.LastIndex) = i.IconFamily.Icon(26)
For a family type? In other words, I may not have a handle to an actual file, but I want to display the icon that the user’s system would normally assign to a file of the type defined by the extension provided.
It’s not the resolution that I’m looking for, but rather a way to retrieve the general icon for a “type” of file. In the above code, I’m getting the macOS generic “App” icon and I don’t have a folderitem to pass in. What I was doing with the older IconFamily code was getting the general icon for a family type rather than a specific file. Much the same as what you have provided with the new LinuxIconMBS.SymbolicIcon("application/vim", 22) function.
Dim i As New NSImageMBS
i = NSWorkspaceMBS.iconForFileType("fcpbundle")
Me.RowPicture(Me.LastIndex) = i.CopyPictureWithMask.ScaleImageAndMaskMBS(22, 22, True)