views:

397

answers:

1

I already took a look at GetIconRefFromFileInfo() and QLThumbnailImageCreate() but they just doesn't seem to be similar with what I see from the finder, which is a square icon with watermarks on it, e.g. if the file is RTF, it has this greyish watermark below that says RTF or RTFD or PDF...

Please help me out on this. Thanks. If the question is still unclear, please feel free to comment.

A: 

From MacScripter:

This is a category on NSImage which lets you get an image containing a Quick Look preview of the content of a given file. If no Quick Look preview is available, it will instead return the file's Finder icon (this is what the Quick Look panel does). It consists of only one method:

+ (NSImage *) imageWithPreviewOfFileAtPath: (NSString*) path ofSize: (NSSize) size asIcon: (BOOL) icon

mcandre
Hi.Thanks for the answer, but if you saw the code inside `NSImage+QuickLook.m`, it did use `QLThumbnailImageCreate()`, and if it's nil, it'll just use `NSWorkspace`'s provided icon for the file, effectively calling `GetIconRefFromFileInfo()`. I'm sorry but I think this is not the answer I'm looking for.
jopes