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.
views:
190answers:
1
+3
A:
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.
cobbal
2010-01-30 19:10:00