5
Có cách nào để xem hình ảnh xem trước nhanh cho tệp không?Tải hình ảnh xem trước QuickLook cho tệp
Tôi đang tìm một cái gì đó như thế này:
NSImage *image = [QuickLookPreviewer quickLookPreviewForFile:path];
Có cách nào để xem hình ảnh xem trước nhanh cho tệp không?Tải hình ảnh xem trước QuickLook cho tệp
Tôi đang tìm một cái gì đó như thế này:
NSImage *image = [QuickLookPreviewer quickLookPreviewForFile:path];
Xem QLThumbnailRequest
trong tài liệu: 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);