I'm using iconForFile:
selector of NSWorkspace
class, but it returns an image of low quality.
Can anyone tell me why is this happening? Is there any switch or flag to tell the framework to return an image in a different format?
The docs state the returned icon's size is 32x32, but you can use -[NSImage setSize:]
and it may load a larger representation:
NSImage * iconImage = [[NSWorkspace sharedWorkspace] iconForFile:file];
[iconImage setSize:NSMakeSize(128, 128)];
You can also use Icon Services (e.g. GetIconRefFromFileInfo
) or QuickLook (e.g. QLThumbnailImageCreate
) for a file's icon or preview icon at a larger size.
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