5
有什么办法可以快速查看文件的预览图像吗?获取文件的快速查看预览图像
我正在寻找这样的事情:
NSImage *image = [QuickLookPreviewer quickLookPreviewForFile:path];
有什么办法可以快速查看文件的预览图像吗?获取文件的快速查看预览图像
我正在寻找这样的事情:
NSImage *image = [QuickLookPreviewer quickLookPreviewForFile:path];
见QLThumbnailRequest
在docs:https://developer.apple.com/library/mac/#documentation/UserExperience/Reference/QLThumbnailRequest_Ref/Reference/reference.html
NSURL *path = aFileUrl;
NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:(NSString *)kQLThumbnailOptionIconModeKey];
CGImageRef ref = QLThumbnailImageCreate(kCFAllocatorDefault, (CFURLRef)path, CGSizeMake(600, 800 /* Or whatever size you want */), (CFDictionaryRef)options);