I am looking for a method exactly like -[NSWorkspace iconForFile:]
but which returns the icon in a higher resolution if possible. In particular, I have an app which makes use of QuickLook to display previews of files, and I'd like it to fall back to the file icon if no quick look plugin is available. Using the iconForFile:
method, however, yields a small 32x32 icon. Is there a better method around? One that returns an NSImage
or CGImageRef
is preferred, but less accessible methods might be fine too.
The returned image of -[NSWorkspace iconForFile:]
contains multiple representations, including higher resolution ones.
If you try drawing it at 512x512 it will automatically pick the appropriate representation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With