High resolution icon for file in Mac OS X?

I am looking for a method similar to -[NSWorkspace iconForFile:] , but which returns the icon in higher resolution, if possible. In particular, I have an application that uses QuickLook to display file previews, and I would like it to return to the file icon if there is no smooth viewing of the plugin. However, using the iconForFile: method gives a small 32x32 icon. Is there a better way? One that returns NSImage or CGImageRef is preferred, but less accessible methods can also be great.

+6
cocoa icons macos
source share
2 answers

The returned image -[NSWorkspace iconForFile:] contains several views, including higher resolutions.

If you try to draw on 512x512, it will automatically select the appropriate view.

+5
source share

Here's how to make the icon bigger:

 NSImage * icon = [NSWorkspace iconForFile:yourPath]; [icon setSize:NSMakeSize(64,64)]; 

Here it is. Good luck

+3
source share

All Articles